1 |
#!/bin/bash |
#!/bin/bash |
2 |
|
# $Id$ |
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 |
|
|
|
# $Header: /home/cvsd/alx-cvs/alx-src/alxconfig-ng/init.d/alxsettings,v 1.26 2005-10-10 21:19:08 niro Exp $ |
|
|
|
|
14 |
# 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 |
15 |
# if not it runs the autoconfiguration script |
# if not it runs the autoconfiguration script |
16 |
# these settings will be used for client setup |
# these settings will be used for client setup |
19 |
# if no changes are at server side they will be kept, if yes the get updated. |
# if no changes are at server side they will be kept, if yes the get updated. |
20 |
# the server settings has higher priority. |
# the server settings has higher priority. |
21 |
|
|
22 |
source /etc/sysconfig/rc |
source /etc/conf.d/rc |
23 |
source $rc_functions |
source $rc_functions |
24 |
|
|
25 |
# mysql settings |
# mysql settings |
26 |
source /etc/alxconfig-ng/config.rc |
source /etc/alxconfig-ng/config.rc |
27 |
|
|
28 |
# helper functions |
# helper functions |
29 |
|
source /usr/lib/alxconfig-ng/functions/common |
30 |
source /usr/lib/alxconfig-ng/functions/mysqlfunctions |
source /usr/lib/alxconfig-ng/functions/mysqlfunctions |
31 |
source /usr/lib/alxconfig-ng/functions/serial_functions |
source /usr/lib/alxconfig-ng/functions/serial_functions |
32 |
source /usr/lib/alxconfig-ng/functions/config_modules |
source /usr/lib/alxconfig-ng/functions/config_modules |
36 |
source /usr/lib/alxconfig-ng/functions/config_x11 |
source /usr/lib/alxconfig-ng/functions/config_x11 |
37 |
source /usr/lib/alxconfig-ng/functions/config_auth |
source /usr/lib/alxconfig-ng/functions/config_auth |
38 |
source /usr/lib/alxconfig-ng/functions/config_ssh_auth |
source /usr/lib/alxconfig-ng/functions/config_ssh_auth |
39 |
|
source /usr/lib/alxconfig-ng/functions/config_versions |
|
# check if mysql is available |
|
|
[ -x /usr/bin/mysql ] && MYSQL_ALX=true |
|
40 |
|
|
41 |
# other needed vars |
# other needed vars |
42 |
ALX_HW_DETECT=false |
ALX_HW_DETECT=false |
90 |
|
|
91 |
# exchange ssh rsa keys |
# exchange ssh rsa keys |
92 |
HOME=/root config_ssh_auth |
HOME=/root config_ssh_auth |
93 |
|
|
94 |
|
# import version info |
95 |
|
config_version |
96 |
} |
} |
97 |
|
|
98 |
get_system_serial() |
get_system_serial() |
122 |
exit 1 |
exit 1 |
123 |
fi |
fi |
124 |
|
|
125 |
CUR_IP=$(/sbin/ifconfig ${ALX_IFACE} | sed -n '/addr:/s/ [^r]*..//gp') |
CUR_IP=$(ifconfig ${ALX_IFACE} | sed -n '/addr:/s/ [^r]*..//gp') |
126 |
CUR_MAC=$(/sbin/ifconfig ${ALX_IFACE} | grep HWaddr | cut -d ' ' -f11) |
CUR_MAC=$(ifconfig ${ALX_IFACE} | grep HWaddr | cut -d ' ' -f11) |
127 |
CUR_MTIME=$(date +%s) |
CUR_MTIME=$(date +%s) |
128 |
|
|
129 |
echo -e ${COLOREDSTAR} "Trying to validate my serial ..." |
echo -e ${COLOREDSTAR} "Trying to validate my serial ..." |
139 |
else |
else |
140 |
# abort on non valid serial |
# abort on non valid serial |
141 |
ALX_STATE="invalid serial" |
ALX_STATE="invalid serial" |
142 |
echo "ALX_STATE=${ALX_STATE}" > /etc/alxconfig-ng/state/state |
echo "ALX_STATE=\"${ALX_STATE}\"" > /etc/alxconfig-ng/state/state |
143 |
show_invalid_serial_msg |
show_invalid_serial_msg |
144 |
exit 1 |
exit 1 |
145 |
fi |
fi |
150 |
if [[ ${ALX_FORCED_RECHECK} = true ]] |
if [[ ${ALX_FORCED_RECHECK} = true ]] |
151 |
then |
then |
152 |
echo -e ${COLMAGENTA}"Hardware autodetection forced by system-administrator"${COLDEFAULT} |
echo -e ${COLMAGENTA}"Hardware autodetection forced by system-administrator"${COLDEFAULT} |
153 |
|
# always disable CONFD_NETWORKING here |
154 |
|
export ALX_CONFD_NETWORKING="false" |
155 |
else |
else |
156 |
echo -e ${COLMAGENTA}"Preparing system for first boot"${COLDEFAULT} |
echo -e ${COLMAGENTA}"Preparing system for first boot"${COLDEFAULT} |
157 |
fi |
fi |
158 |
ALX_HW_DETECT=true |
ALX_HW_DETECT=true |
159 |
/etc/init.d/hwdetect start |
hwsetup |
160 |
|
|
161 |
# set hostname to alx_default_hostname |
# set hostname to alx_default_hostname |
162 |
# use old hostname if this is a forced re-check |
# use old hostname if this is a forced re-check |
178 |
exit 1 |
exit 1 |
179 |
fi |
fi |
180 |
|
|
181 |
|
|
182 |
CUR_IP=$(/sbin/ifconfig eth0 | sed -n '/addr:/s/ [^r]*..//gp') |
CUR_IP=$(/sbin/ifconfig eth0 | sed -n '/addr:/s/ [^r]*..//gp') |
183 |
CUR_MAC=$(/sbin/ifconfig eth0 | grep HWaddr | cut -d ' ' -f11) |
CUR_MAC=$(/sbin/ifconfig eth0 | grep HWaddr | cut -d ' ' -f11) |
184 |
CUR_MTIME=$(date +%s) |
CUR_MTIME=$(date +%s) |
208 |
fi |
fi |
209 |
|
|
210 |
# write current state to temp file |
# write current state to temp file |
211 |
echo "ALX_STATE=${ALX_STATE}" > /etc/alxconfig-ng/state/state |
echo "ALX_STATE=\"${ALX_STATE}\"" > /etc/alxconfig-ng/state/state |
212 |
[ -f /hardware-auto-detection ] && rm /hardware-auto-detection |
[ -f /hardware-auto-detection ] && rm /hardware-auto-detection |
213 |
|
|
214 |
# now export ALX_FORCED_RECHECK=true |
# now export ALX_FORCED_RECHECK=true |
233 |
# set ALX_STATE to ok so everybody knows that everything was ok |
# set ALX_STATE to ok so everybody knows that everything was ok |
234 |
ALX_STATE=ok |
ALX_STATE=ok |
235 |
|
|
236 |
echo "ALX_SERIAL=${ALX_SERIAL}" > /etc/alxconfig-ng/serial |
echo "ALX_SERIAL=\"${ALX_SERIAL}\"" > /etc/alxconfig-ng/serial |
237 |
echo "ALX_REG_DATE=${CUR_MTIME}" >> /etc/alxconfig-ng/serial |
echo "ALX_REG_DATE=\"${CUR_MTIME}\"" >> /etc/alxconfig-ng/serial |
238 |
|
|
239 |
evaluate_retval |
evaluate_retval |
240 |
else |
else |
253 |
fi |
fi |
254 |
|
|
255 |
# write current state to temp file |
# write current state to temp file |
256 |
echo "ALX_STATE=${ALX_STATE}" > /etc/alxconfig-ng/state/state |
echo "ALX_STATE=\"${ALX_STATE}\"" > /etc/alxconfig-ng/state/state |
257 |
echo "ALX_IFACE=${ALX_IFACE}" >> /etc/alxconfig-ng/state/state |
echo "ALX_IFACE=\"${ALX_IFACE}\"" >> /etc/alxconfig-ng/state/state |
258 |
} |
} |
259 |
|
|
260 |
|
|
279 |
[ -z "${ALX_DEFAULT_DOMAIN}" ] && ALX_DEFAULT_DOMAIN=localdomain |
[ -z "${ALX_DEFAULT_DOMAIN}" ] && ALX_DEFAULT_DOMAIN=localdomain |
280 |
[ -z "${ALX_DEFAULT_HOSTNAME}" ] && ALX_DEFAULT_HOSTNAME=magellan-alx |
[ -z "${ALX_DEFAULT_HOSTNAME}" ] && ALX_DEFAULT_HOSTNAME=magellan-alx |
281 |
|
|
282 |
# vars used by hwdetect |
# vars used by hwsetup |
283 |
local NETCARD_FULLNAME NETCARD_DRIVER MOUSE_FULLNAME MOUSE_DEVICE SOUND_FULLNAME |
local NETCARD_FULLNAME NETCARD_DRIVER MOUSE_FULLNAME MOUSE_DEVICE SOUND_FULLNAME |
284 |
local SOUND_DRIVER XSERVER XMODULE XDESC FLOPPY_FULLNAME FLOPPY_DEVICE FLOPPY_DRIVER |
local SOUND_DRIVER XSERVER XMODULE XDESC FLOPPY_FULLNAME FLOPPY_DEVICE FLOPPY_DRIVER |
285 |
local MOUSETYPE XMOUSETYPE FULLNAME DEVICE |
local MOUSETYPE XMOUSETYPE FULLNAME DEVICE |
286 |
|
|
287 |
# get setting from hwdetect |
# get setting from hwsetup |
288 |
source /etc/sysconfig/hwsetup/knoppix |
source /etc/conf.d/hwsetup/knoppix |
289 |
source /etc/sysconfig/hwsetup/mouse |
source /etc/conf.d/hwsetup/mouse |
290 |
|
|
291 |
echo |
echo |
292 |
echo -e ${COLMAGENTA}"Importing detected settings to database"${COLDEFAULT} |
echo -e ${COLMAGENTA}"Importing detected settings to database"${COLDEFAULT} |
302 |
[[ $(< ${SETTINGSPATH}/confd-networking) != ${iface} ]] && continue |
[[ $(< ${SETTINGSPATH}/confd-networking) != ${iface} ]] && continue |
303 |
echo "WARNING: only importing settings for interface [ ${iface} ] !" |
echo "WARNING: only importing settings for interface [ ${iface} ] !" |
304 |
source ${network_settings}/net.${iface} || exit 1 |
source ${network_settings}/net.${iface} || exit 1 |
305 |
NETCARD_DRIVER="$(cat /etc/modules.d/net.${iface} | cut -d' ' -f3)" |
NETCARD_DRIVER="$(cat /etc/modprobe.d/net.${iface}.conf | cut -d' ' -f3)" |
306 |
|
|
307 |
mysqldo "insert into cfg_network( |
mysqldo "insert into cfg_network( |
308 |
hostname, |
hostname, |
380 |
module, |
module, |
381 |
resolution, |
resolution, |
382 |
depth, |
depth, |
383 |
monitorid |
refresh_rate |
384 |
) |
) |
385 |
values( |
values( |
386 |
'${ALX_SERIAL}', |
'${ALX_SERIAL}', |
387 |
'${XMODULE}', |
'${XMODULE}', |
388 |
'1024x768', |
'1024x768', |
389 |
'16', |
'16', |
390 |
'0' |
'60' |
391 |
);"; ) |
);"; ) |
392 |
evaluate_retval |
evaluate_retval |
393 |
|
|
430 |
echo -e " Screensaver settings ..." |
echo -e " Screensaver settings ..." |
431 |
mysqldo "insert into cfg_screensaver(serial,screensaver) values('${ALX_SERIAL}','')" |
mysqldo "insert into cfg_screensaver(serial,screensaver) values('${ALX_SERIAL}','')" |
432 |
|
|
433 |
|
# version info |
434 |
|
local alx_os |
435 |
|
local alx_utils |
436 |
|
alx_os="$(< /etc/mageversion)" |
437 |
|
alx_utils="$(magequery -n alxconfig-ng-alx | sed 's:.*\[\ \(.*\)\ \].*:\1:')" |
438 |
|
alx_utils="${alx_utils/alxconfig-ng-alx-}" |
439 |
|
mysqldo "insert into client_version(serial,os,utils) values('${ALX_SERIAL}','${alx_os}','${alx_utils}')" |
440 |
|
|
441 |
evaluate_retval |
evaluate_retval |
442 |
} |
} |
443 |
|
|
452 |
[ -z "${ALX_DEFAULT_DOMAIN}" ] && ALX_DEFAULT_DOMAIN=localdomain |
[ -z "${ALX_DEFAULT_DOMAIN}" ] && ALX_DEFAULT_DOMAIN=localdomain |
453 |
[ -z "${ALX_DEFAULT_HOSTNAME}" ] && ALX_DEFAULT_HOSTNAME=magellan-alx |
[ -z "${ALX_DEFAULT_HOSTNAME}" ] && ALX_DEFAULT_HOSTNAME=magellan-alx |
454 |
|
|
455 |
# vars used by hwdetect |
# vars used by hwsetup |
456 |
local NETCARD_FULLNAME NETCARD_DRIVER MOUSE_FULLNAME MOUSE_DEVICE SOUND_FULLNAME |
local NETCARD_FULLNAME NETCARD_DRIVER MOUSE_FULLNAME MOUSE_DEVICE SOUND_FULLNAME |
457 |
local SOUND_DRIVER XSERVER XMODULE XDESC FLOPPY_FULLNAME FLOPPY_DEVICE FLOPPY_DRIVER |
local SOUND_DRIVER XSERVER XMODULE XDESC FLOPPY_FULLNAME FLOPPY_DEVICE FLOPPY_DRIVER |
458 |
local MOUSETYPE XMOUSETYPE FULLNAME DEVICE |
local MOUSETYPE XMOUSETYPE FULLNAME DEVICE |
459 |
|
|
460 |
# get setting from hwdetect |
# get setting from hwsetup |
461 |
source /etc/sysconfig/hwsetup/knoppix |
source /etc/conf.d/hwsetup/knoppix |
462 |
source /etc/sysconfig/hwsetup/mouse |
source /etc/conf.d/hwsetup/mouse |
463 |
|
|
464 |
echo |
echo |
465 |
echo -e ${COLMAGENTA}"Updating detected settings in database"${COLDEFAULT} |
echo -e ${COLMAGENTA}"Updating detected settings in database"${COLDEFAULT} |
475 |
[[ $(< ${SETTINGSPATH}/confd-networking) != ${iface} ]] && continue |
[[ $(< ${SETTINGSPATH}/confd-networking) != ${iface} ]] && continue |
476 |
echo "WARNING: only importing settings for interface [ ${iface} ] !" |
echo "WARNING: only importing settings for interface [ ${iface} ] !" |
477 |
source ${network_settings}/net.${iface} || exit 1 |
source ${network_settings}/net.${iface} || exit 1 |
478 |
NETCARD_DRIVER="$(cat /etc/modules.d/net.${iface} | cut -d' ' -f3)" |
NETCARD_DRIVER="$(cat /etc/modprobe.d/net.${iface}.conf | cut -d' ' -f3)" |
479 |
|
|
480 |
mysqldo "update cfg_network set |
mysqldo "update cfg_network set |
481 |
hostname='${ALX_DEFAULT_HOSTNAME}', |
hostname='${ALX_DEFAULT_HOSTNAME}', |
520 |
module='${XMODULE}', |
module='${XMODULE}', |
521 |
resolution='1024x768', |
resolution='1024x768', |
522 |
depth='16', |
depth='16', |
523 |
monitorid='0' |
refresh_rate='60' |
524 |
where serial=${ALX_SERIAL};" |
where serial=${ALX_SERIAL};" |
525 |
evaluate_retval |
evaluate_retval |
526 |
|
|
528 |
echo -e " Input settings ..." |
echo -e " Input settings ..." |
529 |
mysqldo "update cfg_input set mouse='${XMOUSETYPE}' where serial=${ALX_SERIAL};" |
mysqldo "update cfg_input set mouse='${XMOUSETYPE}' where serial=${ALX_SERIAL};" |
530 |
evaluate_retval |
evaluate_retval |
531 |
|
|
532 |
|
# version info |
533 |
|
local alx_os |
534 |
|
local alx_utils |
535 |
|
alx_os="$(< /etc/mageversion)" |
536 |
|
alx_utils="$(magequery -n alxconfig-ng-alx | sed 's:.*\[\ \(.*\)\ \].*:\1:')" |
537 |
|
alx_utils="${alx_utils/alxconfig-ng-alx-}" |
538 |
|
mysqldo "update client_version set os='${alx_os}', utils='${alx_utils}' where serial=${ALX_SERIAL};" |
539 |
} |
} |
540 |
|
|
541 |
# imports current settings to the local system resolved by the hardware detection |
# imports current settings to the local system resolved by the hardware detection |
549 |
[ -z "${ALX_DEFAULT_DOMAIN}" ] && ALX_DEFAULT_DOMAIN=localdomain |
[ -z "${ALX_DEFAULT_DOMAIN}" ] && ALX_DEFAULT_DOMAIN=localdomain |
550 |
[ -z "${ALX_DEFAULT_HOSTNAME}" ] && ALX_DEFAULT_HOSTNAME=magellan-alx |
[ -z "${ALX_DEFAULT_HOSTNAME}" ] && ALX_DEFAULT_HOSTNAME=magellan-alx |
551 |
|
|
552 |
# vars used by hwdetect |
# vars used by hwsetup |
553 |
local NETCARD_FULLNAME NETCARD_DRIVER MOUSE_FULLNAME MOUSE_DEVICE SOUND_FULLNAME |
local NETCARD_FULLNAME NETCARD_DRIVER MOUSE_FULLNAME MOUSE_DEVICE SOUND_FULLNAME |
554 |
local SOUND_DRIVER XSERVER XMODULE XDESC FLOPPY_FULLNAME FLOPPY_DEVICE FLOPPY_DRIVER |
local SOUND_DRIVER XSERVER XMODULE XDESC FLOPPY_FULLNAME FLOPPY_DEVICE FLOPPY_DRIVER |
555 |
local MOUSETYPE XMOUSETYPE FULLNAME DEVICE |
local MOUSETYPE XMOUSETYPE FULLNAME DEVICE |
556 |
|
|
557 |
# get setting from hwdetect |
# get setting from hwsetup |
558 |
source /etc/sysconfig/hwsetup/knoppix |
source /etc/conf.d/hwsetup/knoppix |
559 |
|
|
560 |
echo |
echo |
561 |
echo -e ${COLMAGENTA}"Importing detected settings to local system"${COLDEFAULT} |
echo -e ${COLMAGENTA}"Importing detected settings to local system"${COLDEFAULT} |
562 |
|
|
563 |
if [[ ${ALX_CONFD_NETWORKING} = false ]] |
if [[ ${ALX_CONFD_NETWORKING} = false ]] |
564 |
then |
then |
|
#[ ! -d ${SETTINGSPATH} ] && install -d ${SETTINGSPATH} |
|
|
#echo "${NETCARD_DRIVER}" > ${SETTINGSPATH}/modules |
|
|
|
|
565 |
# set an device alias for modprobe.conf |
# set an device alias for modprobe.conf |
566 |
[ ! -d /etc/modules.d ] && install -d /etc/modules.d |
[ ! -d /etc/modprobe.d ] && install -d /etc/modprobe.d |
567 |
echo "alias eth0 ${NETCARD_DRIVER}" > /etc/modules.d/net.eth0 |
echo "alias eth0 ${NETCARD_DRIVER}" > /etc/modprobe.d/net.eth0.conf |
568 |
|
|
569 |
# regenerate modprobe.conf |
# regenerate modprobe.conf |
570 |
[ -x $(which modules-update) ] && modules-update || echo "cannot regen modprobe.conf" |
[ -x $(which modules-update) ] && modules-update || echo "cannot regen modprobe.conf" |
574 |
# set system state to 'already configured' |
# set system state to 'already configured' |
575 |
touch /etc/alxconfig-ng/state/configured |
touch /etc/alxconfig-ng/state/configured |
576 |
|
|
577 |
|
# install slim desktopmanager configuration |
578 |
|
config_display_manager |
579 |
|
|
580 |
# if only an recheck was forced than abort now |
# if only an recheck was forced than abort now |
581 |
[[ ${ALX_FORCED_RECHECK} = true ]] && return 0 |
[[ ${ALX_FORCED_RECHECK} = true ]] && return 0 |
582 |
|
|
587 |
# now generate fluxbox config files |
# now generate fluxbox config files |
588 |
|
|
589 |
# fluxbox main config |
# fluxbox main config |
590 |
cat ${ALX_SKELETONS}/fluxbox/init \ |
cat ${ALX_SKELETONS}/fluxbox/init > ${ALX_UNPRIV_HOME}/.fluxbox/init |
|
> ${ALX_UNPRIV_HOME}/.fluxbox/init |
|
591 |
|
|
592 |
# fluxbox autostart |
# fluxbox autostart |
593 |
cat ${ALX_SKELETONS}/fluxbox/apps \ |
cat ${ALX_SKELETONS}/fluxbox/apps > ${ALX_UNPRIV_HOME}/.fluxbox/apps |
|
> ${ALX_UNPRIV_HOME}/.fluxbox/apps |
|
594 |
|
|
595 |
# fluxbox menu header |
# fluxbox menu header |
596 |
cat ${ALX_SKELETONS}/fluxbox/menu.header \ |
cat ${ALX_SKELETONS}/fluxbox/menu.header > ${ALX_UNPRIV_HOME}/.fluxbox/menu |
|
> ${ALX_UNPRIV_HOME}/.fluxbox/menu |
|
597 |
|
|
598 |
# now fix it with proper messages :P |
# now fix it with proper messages :P |
599 |
local ver="$(< /etc/mageversion)" |
local ver="$(< /etc/mageversion)" |
600 |
sed -i "s:@CHANGEME@:alx-${ver} #${ALX_SERIAL}:g" \ |
sed -i "s:@CHANGEME@:alx-${ver} #${ALX_SERIAL}:g" ${ALX_UNPRIV_HOME}/.fluxbox/menu |
|
${ALX_UNPRIV_HOME}/.fluxbox/menu |
|
601 |
|
|
602 |
# add a newline (maybe there is no crlf in the header) |
# add a newline (maybe there is no crlf in the header) |
603 |
echo >> ${ALX_UNPRIV_HOME}/.fluxbox/menu |
echo >> ${ALX_UNPRIV_HOME}/.fluxbox/menu |
604 |
|
|
605 |
# fluxbox menu footer |
# fluxbox menu footer |
606 |
cat ${ALX_SKELETONS}/fluxbox/menu.footer \ |
cat ${ALX_SKELETONS}/fluxbox/menu.footer >> ${ALX_UNPRIV_HOME}/.fluxbox/menu |
|
>> ${ALX_UNPRIV_HOME}/.fluxbox/menu |
|
607 |
|
|
608 |
# add a newline (maybe there is no crlf in the footer) |
# add a newline (maybe there is no crlf in the footer) |
609 |
echo >> ${ALX_UNPRIV_HOME}/.fluxbox/menu |
echo >> ${ALX_UNPRIV_HOME}/.fluxbox/menu |
643 |
--icon-width "1" \ |
--icon-width "1" \ |
644 |
--icon-height "1" |
--icon-height "1" |
645 |
|
|
646 |
|
# create a xinitrc |
647 |
|
echo "exec startfluxbox" > ${ALX_UNPRIV_HOME}/.xinitrc |
648 |
|
|
649 |
# set correct permissions |
# set correct permissions |
650 |
chown ${ALX_UNPRIV_USER}:${ALX_UNPRIV_GROUP} ${ALX_UNPRIV_HOME} |
chown ${ALX_UNPRIV_USER}:${ALX_UNPRIV_GROUP} ${ALX_UNPRIV_HOME} |
651 |
chown ${ALX_UNPRIV_USER}:${ALX_UNPRIV_GROUP} ${ALX_UNPRIV_HOME}/.fluxbox |
chown ${ALX_UNPRIV_USER}:${ALX_UNPRIV_GROUP} ${ALX_UNPRIV_HOME}/.fluxbox |
652 |
chmod 0755 ${ALX_UNPRIV_HOME}/.fluxbox |
chmod 0755 ${ALX_UNPRIV_HOME}/.fluxbox |
653 |
chmod 0755 ${ALX_UNPRIV_HOME}/.xtdesktop |
chmod 0755 ${ALX_UNPRIV_HOME}/.xtdesktop |
654 |
chmod 0644 ${ALX_UNPRIV_HOME}/.xtdeskrc |
chmod 0644 ${ALX_UNPRIV_HOME}/.xtdeskrc |
655 |
|
chmod 0644 ${ALX_UNPRIV_HOME}/.xinitrc |
656 |
} |
} |
657 |
|
|
658 |
# start|stop |
# start|stop |
669 |
module=$(cat ${SETTINGSPATH}/modules) |
module=$(cat ${SETTINGSPATH}/modules) |
670 |
modprobe ${module} |
modprobe ${module} |
671 |
fi |
fi |
672 |
|
|
673 |
else |
else |
674 |
# vars used by hwdetect |
# vars used by hwsetup |
675 |
local NETCARD_FULLNAME NETCARD_DRIVER MOUSE_FULLNAME MOUSE_DEVICE SOUND_FULLNAME |
local NETCARD_FULLNAME NETCARD_DRIVER MOUSE_FULLNAME MOUSE_DEVICE SOUND_FULLNAME |
676 |
local SOUND_DRIVER XSERVER XMODULE XDESC FLOPPY_FULLNAME FLOPPY_DEVICE FLOPPY_DRIVER |
local SOUND_DRIVER XSERVER XMODULE XDESC FLOPPY_FULLNAME FLOPPY_DEVICE FLOPPY_DRIVER |
677 |
|
|
678 |
# get setting from hwdetect |
# get setting from hwsetup |
679 |
source /etc/sysconfig/hwsetup/knoppix |
source /etc/conf.d/hwsetup/knoppix |
680 |
modprobe ${NETCARD_DRIVER} |
modprobe ${NETCARD_DRIVER} |
681 |
fi |
fi |
682 |
|
|
685 |
# keeping like always safe: |
# keeping like always safe: |
686 |
# no network should be startet here, |
# no network should be startet here, |
687 |
# so we can delete all pid files if one exists |
# so we can delete all pid files if one exists |
688 |
if ps -A|grep dhcpcd > /dev/null |
if [[ ! -z $(pidof udhcpc) ]] |
689 |
then |
then |
690 |
echo -e ${COLMAGENTA}"Forcing network down"${COLDEFAULT} |
echo -e ${COLMAGENTA}"Forcing network down"${COLDEFAULT} |
691 |
dhcpcd -k |
killall udhcpc &> /dev/null |
692 |
sleep 1 |
sleep 1 |
|
else |
|
|
rm -f /var/run/dhcpcd-eth?.pid |
|
693 |
fi |
fi |
694 |
[[ ${ALX_CONFD_NETWORKING} = true ]] && [[ ${RUNLEVEL} != S ]] && \ |
[[ ${ALX_CONFD_NETWORKING} = true ]] && ${rc_base}/init.d/network stop |
|
${rc_base}/init.d/network stop |
|
695 |
|
|
696 |
echo -e ${COLMAGENTA}"Starting preliminary networking ... "${COLDEFAULT} |
echo -e ${COLMAGENTA}"Starting preliminary networking ... "${COLDEFAULT} |
697 |
|
|
702 |
else |
else |
703 |
echo -e ${COLOREDSTAR}"Starting default dhcp based networking ... "${COLDEFAULT} |
echo -e ${COLOREDSTAR}"Starting default dhcp based networking ... "${COLDEFAULT} |
704 |
# -t 10 timeout of 10 secs |
# -t 10 timeout of 10 secs |
705 |
dhcpcd -t 10 &> /dev/null |
udhcpc -t 10 &> /dev/null |
706 |
evaluate_retval |
evaluate_retval |
707 |
fi |
fi |
708 |
;; |
;; |
716 |
echo -e ${COLOREDSTAR}"Stopping default dhcp based networking ... "${COLDEFAULT} |
echo -e ${COLOREDSTAR}"Stopping default dhcp based networking ... "${COLDEFAULT} |
717 |
ifconfig eth0 down |
ifconfig eth0 down |
718 |
fi |
fi |
719 |
if ps -A|grep dhcpcd > /dev/null |
if [[ ! -z $(pidof udhcpc) ]] |
720 |
then |
then |
721 |
dhcpcd -z &> /dev/null |
killall udhcpc &> /dev/null |
722 |
|
sleep 1 |
723 |
fi |
fi |
724 |
evaluate_retval |
evaluate_retval |
725 |
;; |
;; |
758 |
rm -rf /etc/alxconfig-ng/state |
rm -rf /etc/alxconfig-ng/state |
759 |
|
|
760 |
# clear all printers & net-shares |
# clear all printers & net-shares |
761 |
:> /etc/cups/printers.conf |
:> /etc/printcap |
|
:> /etc/samba/smb.conf |
|
762 |
|
|
763 |
# remove inetd, cups & smb from init |
# remove lprng |
764 |
rc-config del inetd &> /dev/null |
rc-config del lprng &> /dev/null |
|
rc-config del cups &> /dev/null |
|
|
rc-config del samba &> /dev/null |
|
765 |
|
|
766 |
# remove all user settings |
# remove all user settings |
767 |
[ -d ${ALX_UNPRIV_HOME} ] && rm -rf ${ALX_UNPRIV_HOME} |
[ -d ${ALX_UNPRIV_HOME} ] && rm -rf ${ALX_UNPRIV_HOME} |
771 |
|
|
772 |
# remove all old nics and modules configs |
# remove all old nics and modules configs |
773 |
find /etc/conf.d -type f -name 'net.*' | xargs rm |
find /etc/conf.d -type f -name 'net.*' | xargs rm |
774 |
find /etc/modules.d -type f -name 'net.*' | xargs rm |
find /etc/modprobe.d -type f -name 'net.*' | xargs rm |
775 |
|
|
776 |
# restore default networking |
# restore default networking |
777 |
cat ${ALX_SKELETONS}/net/net.eth0 > /etc/conf.d/net.eth0 |
cat ${ALX_SKELETONS}/net/net.eth0 > /etc/conf.d/net.eth0 |
906 |
[ -f /etc/alxconfig-ng/state/state ] && rm /etc/alxconfig-ng/state/state |
[ -f /etc/alxconfig-ng/state/state ] && rm /etc/alxconfig-ng/state/state |
907 |
sleep 0.1 |
sleep 0.1 |
908 |
;; |
;; |
909 |
|
|
910 |
*) |
*) |
911 |
echo "Usage: $0 {start|stop} ..." |
echo "Usage: $0 {start|stop} ..." |
912 |
;; |
;; |