Magellan Linux

Diff of /alx-src/branches/alxconf-060/init.d/alxsettings

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

alx-src/branches/alxconf_20060908/init.d/alxsettings revision 1596 by niro, Thu Dec 2 15:19:15 2010 UTC alx-src/branches/alxconf-060/init.d/alxsettings revision 2382 by niro, Tue Jun 14 13:51:37 2011 UTC
# Line 1  Line 1 
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    
# Line 11  Line 11 
11  #%before:  #%before:
12  #%after:  #%after:
13    
 # $Header: /home/cvsd/alx-cvs/alx-src/alxconfig-ng/init.d/alxsettings,v 1.27 2005-10-11 12:10:15 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
# Line 21  Line 19 
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
# Line 39  source /usr/lib/alxconfig-ng/functions/c Line 38  source /usr/lib/alxconfig-ng/functions/c
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  source /usr/lib/alxconfig-ng/functions/config_versions
40    
 # check if mysql is available  
 [ -x /usr/bin/mysql ] && MYSQL_ALX=true  
   
41  # other needed vars  # other needed vars
42  ALX_HW_DETECT=false  ALX_HW_DETECT=false
43  ALX_FORCED_RECHECK=false  ALX_FORCED_RECHECK=false
# Line 71  read_cmdline() Line 67  read_cmdline()
67    
68  update_system_settings()  update_system_settings()
69  {  {
70   echo -e ${COLMAGENTA}"Checking system setup ..."${COLDEFAULT}   rc_mecho Checking system setup ...
71    
72   # get the modules settings   # get the modules settings
73   # ! is the first thing that must be configured !   # ! is the first thing that must be configured !
# Line 126  get_system_serial() Line 122  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 ..."   rc_print "Trying to validate my serial ..."
130    
131   # nice serial output   # nice serial output
132   $CURS_UP   $CURS_UP
# Line 143  get_system_serial() Line 139  get_system_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
# Line 153  get_system_serial() Line 149  get_system_serial()
149   echo   echo
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}   rc_mecho "Hardware autodetection forced by system-administrator"
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}   rc_mecho "Preparing system for first boot"
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
# Line 180  get_system_serial() Line 178  get_system_serial()
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)
# Line 190  get_system_serial() Line 189  get_system_serial()
189   # but first check the serial   # but first check the serial
190   source /etc/alxconfig-ng/serial   source /etc/alxconfig-ng/serial
191    
192   echo -e ${COLOREDSTAR} "Trying to validate my serial ..."   rc_print "Trying to validate my serial ..."
193    
194   # nice serial output   # nice serial output
195   $CURS_UP   $CURS_UP
# Line 209  get_system_serial() Line 208  get_system_serial()
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
# Line 218  get_system_serial() Line 217  get_system_serial()
217   return 0   return 0
218   fi   fi
219    
220   echo -e ${COLOREDSTAR} "Trying to get new serial ..."   rc_print "Trying to get new serial ..."
221    
222   # request a new serial; one command now (cause must be done in the same session)   # request a new serial; one command now (cause must be done in the same session)
223   ALX_SERIAL=$(mysqldo "insert into client_serials (mtime, mac) values('${CUR_MTIME}','${CUR_MAC}');   ALX_SERIAL=$(mysqldo "insert into client_serials (mtime, mac) values('${CUR_MTIME}','${CUR_MAC}');
# Line 234  get_system_serial() Line 233  get_system_serial()
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
# Line 254  get_system_serial() Line 253  get_system_serial()
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    
# Line 280  import_settings_to_db() Line 279  import_settings_to_db()
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}   rc_mecho "Importing detected settings to database"
293    
294   # network   # network
295   echo -e "      Network settings ..."   rc_mecho "      Network settings ..."
296   if [[ ${ALX_CONFD_NETWORKING} = true ]]   if [[ ${ALX_CONFD_NETWORKING} = true ]]
297   then   then
298   # get settings   # get settings
  #source ${rc_base}/init.d/network &> /dev/null  
299   for iface in $(onboot_interface_list ${network_settings}/net.*)   for iface in $(onboot_interface_list ${network_settings}/net.*)
300   do   do
301   [[ $(< ${SETTINGSPATH}/confd-networking) != ${iface} ]] && continue   [[ $(< ${SETTINGSPATH}/confd-networking) != ${iface} ]] && continue
302   echo "WARNING: only importing settings for interface [ ${iface} ] !"   rc_echo "WARNING: only importing settings for interface [ ${iface} ] !"
303   source ${network_settings}/net.${iface} || exit 1   source ${network_settings}/net.${iface} || echo "Error: could not read '${network_settings}/net.${iface}'"
304   NETCARD_DRIVER="$(cat /etc/modules.d/net.${iface} | cut -d' ' -f3)"   NETCARD_DRIVER="$(cat /etc/modprobe.d/net.${iface}.conf | cut -d' ' -f3)"
305    
306   mysqldo "insert into cfg_network(   mysqldo "insert into cfg_network(
307   hostname,   hostname,
# Line 374  import_settings_to_db() Line 372  import_settings_to_db()
372   evaluate_retval   evaluate_retval
373    
374   # xserver   # xserver
375   echo -e "      Graphic settings ..."   rc_mecho "      Graphic settings ..."
376   # xserver general   # xserver general
377   ( mysqldo "insert into cfg_graphic(   ( mysqldo "insert into cfg_graphic(
378   serial,   serial,
# Line 393  import_settings_to_db() Line 391  import_settings_to_db()
391   evaluate_retval   evaluate_retval
392    
393   # input   # input
394   echo -e "      Input settings ..."   rc_mecho "      Input settings ..."
395   mysqldo "insert into cfg_input(serial,mouse) values('${ALX_SERIAL}','${XMOUSETYPE}');"   mysqldo "insert into cfg_input(serial,mouse) values('${ALX_SERIAL}','${XMOUSETYPE}');"
396   evaluate_retval   evaluate_retval
397    
398   # auth   # auth
399   echo -e "      Authentification settings ..."   rc_mecho "      Authentification settings ..."
400   mysqldo "insert into client_auth(   mysqldo "insert into client_auth(
401   serial,   serial,
402   username,   username,
# Line 419  import_settings_to_db() Line 417  import_settings_to_db()
417    
418   # exchange ssh rsa keys - the first boot needs this !   # exchange ssh rsa keys - the first boot needs this !
419   # or no reboot will work via the webadmin   # or no reboot will work via the webadmin
420   echo -e "      SSH authentification settings ..."   rc_mecho "      SSH authentification settings ..."
421   HOME=/root config_ssh_auth   HOME=/root config_ssh_auth
422   evaluate_retval   evaluate_retval
423    
424   # autostart   # autostart
425   echo -e "      Autostart settings ..."   rc_mecho "      Autostart settings ..."
426   mysqldo "insert into cfg_autostart(serial,session) values('${ALX_SERIAL}','');"   mysqldo "insert into cfg_autostart(serial,session) values('${ALX_SERIAL}','');"
427    
428   # screensaver   # screensaver
429   echo -e "      Screensaver settings ..."   rc_mecho "      Screensaver settings ..."
430   mysqldo "insert into cfg_screensaver(serial,screensaver) values('${ALX_SERIAL}','')"   mysqldo "insert into cfg_screensaver(serial,screensaver) values('${ALX_SERIAL}','')"
431    
432   # version info   # version info
433     rc_mecho "      OS version info ..."
434   local alx_os   local alx_os
435   local alx_utils   local alx_utils
436   alx_os="$(< /etc/mageversion)"   alx_os="$(< /etc/mageversion)"
# Line 453  update_settings_in_db() Line 452  update_settings_in_db()
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}   rc_mecho "Updating detected settings in database"
466    
467   # network   # network
468   echo -e "      Network settings ..."   rc_mecho "      Network settings ..."
469   if [[ ${ALX_CONFD_NETWORKING} = true ]]   if [[ ${ALX_CONFD_NETWORKING} = true ]]
470   then   then
471   # get settings   # get settings
# Line 474  update_settings_in_db() Line 473  update_settings_in_db()
473   for iface in $(onboot_interface_list ${network_settings}/net.*)   for iface in $(onboot_interface_list ${network_settings}/net.*)
474   do   do
475   [[ $(< ${SETTINGSPATH}/confd-networking) != ${iface} ]] && continue   [[ $(< ${SETTINGSPATH}/confd-networking) != ${iface} ]] && continue
476   echo "WARNING: only importing settings for interface [ ${iface} ] !"   rc_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}',
# Line 515  update_settings_in_db() Line 514  update_settings_in_db()
514   evaluate_retval   evaluate_retval
515    
516   # xserver   # xserver
517   echo -e "      Graphic settings ..."   rc_mecho "      Graphic settings ..."
518   # xserver general   # xserver general
519   mysqldo "update cfg_graphic set   mysqldo "update cfg_graphic set
520   module='${XMODULE}',   module='${XMODULE}',
# Line 526  update_settings_in_db() Line 525  update_settings_in_db()
525   evaluate_retval   evaluate_retval
526    
527   # input   # input
528   echo -e "      Input settings ..."   rc_mecho "      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   # version info
533     rc_mecho "      OS version info ..."
534   local alx_os   local alx_os
535   local alx_utils   local alx_utils
536   alx_os="$(< /etc/mageversion)"   alx_os="$(< /etc/mageversion)"
# Line 550  import_settings_local() Line 550  import_settings_local()
550   [ -z "${ALX_DEFAULT_DOMAIN}" ] && ALX_DEFAULT_DOMAIN=localdomain   [ -z "${ALX_DEFAULT_DOMAIN}" ] && ALX_DEFAULT_DOMAIN=localdomain
551   [ -z "${ALX_DEFAULT_HOSTNAME}" ] && ALX_DEFAULT_HOSTNAME=magellan-alx   [ -z "${ALX_DEFAULT_HOSTNAME}" ] && ALX_DEFAULT_HOSTNAME=magellan-alx
552    
553   # vars used by hwdetect   # vars used by hwsetup
554   local NETCARD_FULLNAME NETCARD_DRIVER MOUSE_FULLNAME MOUSE_DEVICE SOUND_FULLNAME   local NETCARD_FULLNAME NETCARD_DRIVER MOUSE_FULLNAME MOUSE_DEVICE SOUND_FULLNAME
555   local SOUND_DRIVER XSERVER XMODULE XDESC FLOPPY_FULLNAME FLOPPY_DEVICE FLOPPY_DRIVER   local SOUND_DRIVER XSERVER XMODULE XDESC FLOPPY_FULLNAME FLOPPY_DEVICE FLOPPY_DRIVER
556   local MOUSETYPE XMOUSETYPE FULLNAME DEVICE   local MOUSETYPE XMOUSETYPE FULLNAME DEVICE
557    
558   # get setting from hwdetect   # get setting from hwsetup
559   source /etc/sysconfig/hwsetup/knoppix   source /etc/conf.d/hwsetup/knoppix
560    
561   echo   echo
562   echo -e ${COLMAGENTA}"Importing detected settings to local system"${COLDEFAULT}   rc_mecho "Importing detected settings to local system"
563    
564   if [[ ${ALX_CONFD_NETWORKING} = false ]]   if [[ ${ALX_CONFD_NETWORKING} = false ]]
565   then   then
  #[ ! -d ${SETTINGSPATH} ] && install -d ${SETTINGSPATH}  
  #echo "${NETCARD_DRIVER}" > ${SETTINGSPATH}/modules  
   
566   # set an device alias for modprobe.conf   # set an device alias for modprobe.conf
567   [ ! -d /etc/modules.d ] && install -d /etc/modules.d   [ ! -d /etc/modprobe.d ] && install -d /etc/modprobe.d
568   echo "alias eth0 ${NETCARD_DRIVER}" > /etc/modules.d/net.eth0   echo "alias eth0 ${NETCARD_DRIVER}" > /etc/modprobe.d/net.eth0.conf
569    
570   # regenerate modprobe.conf   # regenerate modprobe.conf
571   [ -x $(which modules-update) ] && modules-update || echo "cannot regen modprobe.conf"   [ -x $(which modules-update) ] && modules-update || rc_echo "modules-update not found!"
572   evaluate_retval   evaluate_retval
573   fi   fi
574    
575   # set system state to 'already configured'   # set system state to 'already configured'
576   touch /etc/alxconfig-ng/state/configured   touch /etc/alxconfig-ng/state/configured
577    
578     # install slim desktopmanager configuration
579     config_display_manager
580    
581   # if only an recheck was forced than abort now   # if only an recheck was forced than abort now
582   [[ ${ALX_FORCED_RECHECK} = true ]] && return 0   [[ ${ALX_FORCED_RECHECK} = true ]] && return 0
583    
# Line 588  import_settings_local() Line 588  import_settings_local()
588   # now generate fluxbox config files   # now generate fluxbox config files
589    
590   # fluxbox main config   # fluxbox main config
591   cat ${ALX_SKELETONS}/fluxbox/init \   cat ${ALX_SKELETONS}/fluxbox/init > ${ALX_UNPRIV_HOME}/.fluxbox/init
  > ${ALX_UNPRIV_HOME}/.fluxbox/init  
592    
593   # fluxbox autostart   # fluxbox autostart
594   cat ${ALX_SKELETONS}/fluxbox/apps \   cat ${ALX_SKELETONS}/fluxbox/apps > ${ALX_UNPRIV_HOME}/.fluxbox/apps
  > ${ALX_UNPRIV_HOME}/.fluxbox/apps  
595    
596   # fluxbox menu header   # fluxbox menu header
597   cat ${ALX_SKELETONS}/fluxbox/menu.header \   cat ${ALX_SKELETONS}/fluxbox/menu.header > ${ALX_UNPRIV_HOME}/.fluxbox/menu
  > ${ALX_UNPRIV_HOME}/.fluxbox/menu  
598    
599   # now fix it with proper messages :P   # now fix it with proper messages :P
600   local ver="$(< /etc/mageversion)"   local ver="$(< /etc/mageversion)"
601   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  
602    
603   # add a newline (maybe there is no crlf in the header)   # add a newline (maybe there is no crlf in the header)
604   echo >> ${ALX_UNPRIV_HOME}/.fluxbox/menu   echo >> ${ALX_UNPRIV_HOME}/.fluxbox/menu
605    
606   # fluxbox menu footer   # fluxbox menu footer
607   cat ${ALX_SKELETONS}/fluxbox/menu.footer \   cat ${ALX_SKELETONS}/fluxbox/menu.footer >> ${ALX_UNPRIV_HOME}/.fluxbox/menu
  >> ${ALX_UNPRIV_HOME}/.fluxbox/menu  
608    
609   # add a newline (maybe there is no crlf in the footer)   # add a newline (maybe there is no crlf in the footer)
610   echo >> ${ALX_UNPRIV_HOME}/.fluxbox/menu   echo >> ${ALX_UNPRIV_HOME}/.fluxbox/menu
611    
   
612   # setup some standart icons (sysinfo.lnk)   # setup some standart icons (sysinfo.lnk)
  # basic config  
  cat ${ALX_SKELETONS}/xtdesktop/xtdeskrc > ${ALX_UNPRIV_HOME}/.xtdeskrc  
   
613   # clean desktop icon location   # clean desktop icon location
614   [ -d ${ALX_UNPRIV_HOME}/.xtdesktop ] && rm -rf ${ALX_UNPRIV_HOME}/.xtdesktop   [ -d ${ALX_UNPRIV_HOME}/.xtdesktop ] && rm -rf ${ALX_UNPRIV_HOME}/.xtdesktop
615   install -d ${ALX_UNPRIV_HOME}/.xtdesktop   install -d ${ALX_UNPRIV_HOME}/.xtdesktop
616    
617     # basic config
618     cat ${ALX_SKELETONS}/xtdesktop/xtdeskrc > ${ALX_UNPRIV_HOME}/.xtdesktop/xtdeskrc
619    
620   # last but not least gen a icon with some sys informations   # last but not least gen a icon with some sys informations
621   local sysinfo   local sysinfo
622   local osversion   local osversion
# Line 675  preliminary_network() Line 669  preliminary_network()
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    
# Line 690  preliminary_network() Line 685  preliminary_network()
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 $(basename ${ALX_DHCP_PROG})) ]]
689   then   then
690   echo -e ${COLMAGENTA}"Forcing network down"${COLDEFAULT}   rc_mecho "Forcing network down"
691   dhcpcd -k   killall $(basename ${ALX_DHCP_PROG}) &> /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}   rc_mecho "Starting preliminary networking ... "
697    
698   # start network configured from /etc/conf.d   # start network configured from /etc/conf.d
699   if [[ ${ALX_CONFD_NETWORKING} = true ]]   if [[ ${ALX_CONFD_NETWORKING} = true ]]
700   then   then
701   ${rc_base}/init.d/network start   ${rc_base}/init.d/network start
702   else   else
703   echo -e ${COLOREDSTAR}"Starting default dhcp based networking ... "${COLDEFAULT}   rc_print "Starting default dhcp based networking ... "
704   # -t 10 timeout of 10 secs   ${ALX_DHCP_PROG} ${ALX_DHCP_START} &> /dev/null
  dhcpcd -t 10 &> /dev/null  
705   evaluate_retval   evaluate_retval
706   fi   fi
707   ;;   ;;
708    
709   stop)   stop)
710   echo -e ${COLMAGENTA}"Stopping preliminary networking ... "${COLDEFAULT}   rc_mecho "Stopping preliminary networking ... "
711   if [[ ${ALX_CONFD_NETWORKING} = true ]]   if [[ ${ALX_CONFD_NETWORKING} = true ]]
712   then   then
713   ${rc_base}/init.d/network stop   ${rc_base}/init.d/network stop
714   else   else
715   echo -e ${COLOREDSTAR}"Stopping default dhcp based networking ... "${COLDEFAULT}   rc_print "Stopping default dhcp based networking ... "
716   ifconfig eth0 down   ifconfig ${ALX_IFACE} down
717   fi   fi
718   if ps -A|grep dhcpcd > /dev/null   if [[ ! -z $(pidof $(basename ${ALX_DHCP_PROG})) ]]
719   then   then
720   dhcpcd -z  &> /dev/null   killall $(basename ${ALX_DHCP_PROG}) &> /dev/null
721   sleep 1   sleep 1
722   fi   fi
723   evaluate_retval   evaluate_retval
# Line 742  reset_system_settings() Line 733  reset_system_settings()
733  {  {
734   # force load of de kbdkeys   # force load of de kbdkeys
735   loadkeys -q de   loadkeys -q de
736   echo   rc_echo
737   echo -en ${COLRED}   rc_echo -en ${COLRED}
738   echo -n "*** Warning: you are about to reset *all* local settings on this system!"   rc_echo -n "*** Warning: you are about to reset *all* local settings on this system!"
739   echo -e ${COLDEFAULT}   rc_echo -e ${COLDEFAULT}
740   echo "*** Do you really want to continue ?"   rc_echo "*** Do you really want to continue ?"
741   echo -n "*** Enter 'yes' to continue, anything else to abort: "   rc_echo -n "*** Enter 'yes' to continue, anything else to abort: "
742   read kbinsert   read kbinsert
743   if [[ ${kbinsert} = yes ]]   if [[ ${kbinsert} = yes ]]
744   then   then
745   echo -en ${COLRED}   rc_echo -en ${COLRED}
746   echo -n "*** OK, you really want it ... killing all settings: "   rc_echo -n "*** OK, you really want it ... killing all settings: "
747   for i in 3 2 1 now   for i in 3 2 1 now
748   do   do
749   echo -n " ${i}"   rc_echo -n " ${i}"
750   sleep 1   sleep 1
751   done   done
752   echo -e ${COLDEFAULT}   rc_echo -e ${COLDEFAULT}
753    
754   ## reset all settings:   ## reset all settings:
755   rm -rf ${SETTINGSPATH}/*   rm -rf ${SETTINGSPATH}/*
# Line 766  reset_system_settings() Line 757  reset_system_settings()
757   rm -rf /etc/alxconfig-ng/state   rm -rf /etc/alxconfig-ng/state
758    
759   # clear all printers & net-shares   # clear all printers & net-shares
760   :> /etc/cups/printers.conf   :> /etc/printcap
  :> /etc/samba/smb.conf  
761    
762   # remove inetd, cups & smb from init   # remove lprng
763   rc-config del inetd &> /dev/null   rc-config del lprng &> /dev/null
  rc-config del cups &> /dev/null  
  rc-config del samba &> /dev/null  
764    
765   # remove all user settings   # remove all user settings
766   [ -d ${ALX_UNPRIV_HOME} ] && rm -rf ${ALX_UNPRIV_HOME}   [ -d ${ALX_UNPRIV_HOME} ] && rm -rf ${ALX_UNPRIV_HOME}
# Line 782  reset_system_settings() Line 770  reset_system_settings()
770    
771   # remove all old nics and modules configs   # remove all old nics and modules configs
772   find /etc/conf.d -type f -name 'net.*' | xargs rm   find /etc/conf.d -type f -name 'net.*' | xargs rm
773   find /etc/modules.d -type f -name 'net.*' | xargs rm   find /etc/modprobe.d -type f -name 'net.*' | xargs rm
774    
775   # restore default networking   # restore default networking
776   cat ${ALX_SKELETONS}/net/net.eth0 > /etc/conf.d/net.eth0   cat ${ALX_SKELETONS}/net/net.eth0 > /etc/conf.d/net.eth0
777    
778   echo "I am done now, press [Enter] to reboot system ..."   rc_echo "I am done now, press [Enter] to reboot system ..."
779   else   else
780   echo "Aborted, press [Enter] to reboot system ..."   rc_echo "Aborted, press [Enter] to reboot system ..."
781   fi   fi
782   read   read
783   reboot   reboot
# Line 917  case $1 in Line 905  case $1 in
905   [ -f /etc/alxconfig-ng/state/state ] && rm /etc/alxconfig-ng/state/state   [ -f /etc/alxconfig-ng/state/state ] && rm /etc/alxconfig-ng/state/state
906   sleep 0.1   sleep 0.1
907   ;;   ;;
908    
909   *)   *)
910   echo "Usage: $0 {start|stop} ..."   echo "Usage: $0 {start|stop} ..."
911   ;;   ;;
912  esac  esac
   

Legend:
Removed from v.1596  
changed lines
  Added in v.2382