2 |
|
|
3 |
# <niro@magellan-linux.de> |
# <niro@magellan-linux.de> |
4 |
|
|
5 |
#%rlevels: 7:s 0:k 6:k |
#%rlevels: 7:s 0:k |
6 |
#%start: 41 |
#%start: 41 |
7 |
#%stop: 01 |
#%stop: 01 |
8 |
|
|
11 |
#%before: |
#%before: |
12 |
#%after: |
#%after: |
13 |
|
|
14 |
# $Header: /home/cvsd/alx-cvs/alx-src/tinyalxconfig-ng/init.d/alxsettings,v 1.2 2008-06-04 16:52:25 niro Exp $ |
# $Header: /home/cvsd/alx-cvs/alx-src/tinyalxconfig-ng/init.d/alxsettings,v 1.8 2008-06-04 21:05:15 niro Exp $ |
15 |
|
|
16 |
# checks first if the client was already configured and if it has an valid serial |
# checks first if the client was already configured and if it has an valid serial |
17 |
# if not it runs the autoconfiguration script |
# if not it runs the autoconfiguration script |
153 |
else |
else |
154 |
echo -e ${COLMAGENTA}"Preparing system for first boot"${COLDEFAULT} |
echo -e ${COLMAGENTA}"Preparing system for first boot"${COLDEFAULT} |
155 |
fi |
fi |
156 |
|
# cleaning up old data-crap |
157 |
|
if [ -d /etc/sysconfig/hwsetup ] |
158 |
|
then |
159 |
|
echo -e ${COLOREDSTAR}"Cleaning up old data ..." |
160 |
|
rm -f /etc/sysconfig/hwsetup/* |
161 |
|
fi |
162 |
ALX_HW_DETECT=true |
ALX_HW_DETECT=true |
163 |
/etc/init.d/hwdetect start |
echo -en "${COLOREDSTAR}";hwsetup -p > /dev/null |
164 |
|
|
165 |
# set hostname to alx_default_hostname |
# set hostname to alx_default_hostname |
166 |
# use old hostname if this is a forced re-check |
# use old hostname if this is a forced re-check |
547 |
echo |
echo |
548 |
echo -e ${COLMAGENTA}"Importing detected settings to local system"${COLDEFAULT} |
echo -e ${COLMAGENTA}"Importing detected settings to local system"${COLDEFAULT} |
549 |
|
|
|
if [[ ${ALX_CONFD_NETWORKING} = false ]] |
|
|
then |
|
|
#[ ! -d ${SETTINGSPATH} ] && install -d ${SETTINGSPATH} |
|
|
#echo "${NETCARD_DRIVER}" > ${SETTINGSPATH}/modules |
|
|
|
|
|
# set an device alias for modprobe.conf |
|
|
[ ! -d /etc/modules.d ] && install -d /etc/modules.d |
|
|
echo "alias eth0 ${NETCARD_DRIVER}" > /etc/modules.d/net.eth0 |
|
|
|
|
|
# regenerate modprobe.conf |
|
|
[ -x $(which modules-update) ] && modules-update || echo "cannot regen modprobe.conf" |
|
|
evaluate_retval |
|
|
fi |
|
|
|
|
550 |
# set system state to 'already configured' |
# set system state to 'already configured' |
551 |
touch /etc/alxconfig-ng/state/configured |
touch /etc/alxconfig-ng/state/configured |
552 |
|
|
639 |
case $1 in |
case $1 in |
640 |
start) |
start) |
641 |
# keeping like always safe: |
# keeping like always safe: |
642 |
# no network should be startet here, |
# no network should be started here |
643 |
# so we can delete all pid files if one exists |
${rc_base}/init.d/network stop |
|
if ps -A|grep dhcpcd > /dev/null |
|
|
then |
|
|
echo -e ${COLMAGENTA}"Forcing network down"${COLDEFAULT} |
|
|
dhcpcd -k |
|
|
sleep 1 |
|
|
else |
|
|
rm -f /var/run/dhcpcd-eth?.pid |
|
|
fi |
|
|
[[ ${ALX_CONFD_NETWORKING} = true ]] && [[ ${RUNLEVEL} != S ]] && \ |
|
|
${rc_base}/init.d/network stop |
|
644 |
|
|
645 |
echo -e ${COLMAGENTA}"Starting preliminary networking ... "${COLDEFAULT} |
echo -e ${COLMAGENTA}"Starting preliminary networking ... "${COLDEFAULT} |
|
|
|
646 |
# start network configured from /etc/conf.d |
# start network configured from /etc/conf.d |
647 |
if [[ ${ALX_CONFD_NETWORKING} = true ]] |
${rc_base}/init.d/network start |
|
then |
|
|
${rc_base}/init.d/network start |
|
|
else |
|
|
echo -e ${COLOREDSTAR}"Starting default dhcp based networking ... "${COLDEFAULT} |
|
|
# -t 10 timeout of 10 secs |
|
|
dhcpcd -t 10 &> /dev/null |
|
|
evaluate_retval |
|
|
fi |
|
648 |
;; |
;; |
649 |
|
|
650 |
stop) |
stop) |
651 |
echo -e ${COLMAGENTA}"Stopping preliminary networking ... "${COLDEFAULT} |
echo -e ${COLMAGENTA}"Stopping preliminary networking ... "${COLDEFAULT} |
652 |
if [[ ${ALX_CONFD_NETWORKING} = true ]] |
${rc_base}/init.d/network stop |
|
then |
|
|
${rc_base}/init.d/network stop |
|
|
else |
|
|
echo -e ${COLOREDSTAR}"Stopping default dhcp based networking ... "${COLDEFAULT} |
|
|
ifconfig eth0 down |
|
|
fi |
|
|
if ps -A|grep dhcpcd > /dev/null |
|
|
then |
|
|
dhcpcd -z &> /dev/null |
|
|
fi |
|
|
evaluate_retval |
|
653 |
;; |
;; |
654 |
|
|
655 |
*) |
*) |
835 |
# unset_alx_connected #--> now in alxsetstate-rc6 |
# unset_alx_connected #--> now in alxsetstate-rc6 |
836 |
# ! important !: del systemstate |
# ! important !: del systemstate |
837 |
[ -f /etc/alxconfig-ng/state/state ] && rm /etc/alxconfig-ng/state/state |
[ -f /etc/alxconfig-ng/state/state ] && rm /etc/alxconfig-ng/state/state |
|
sleep 0.1 |
|
838 |
;; |
;; |
839 |
*) |
*) |
840 |
echo "Usage: $0 {start|stop} ..." |
echo "Usage: $0 {start|stop} ..." |