Magellan Linux

Diff of /alx-src/tags/alxconf-0_6_0-rc7/init.d/alxsettings

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

alx-src/branches/alxconf-060/init.d/alxsettings revision 2010 by niro, Mon May 9 15:44:33 2011 UTC alx-src/tags/alxconf-0_6_0-rc7/init.d/alxsettings revision 2477 by niro, Mon Jun 27 15:15:31 2011 UTC
# Line 26  source $rc_functions Line 26  source $rc_functions
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 50  unset ALX_SERIAL ALX_STATE Line 51  unset ALX_SERIAL ALX_STATE
51  # setup needed directories  # setup needed directories
52  [ ! -d /etc/alxconfig-ng/state ] && install -d /etc/alxconfig-ng/state  [ ! -d /etc/alxconfig-ng/state ] && install -d /etc/alxconfig-ng/state
53    
   
 # read_cmdline ${item}  
 read_cmdline()  
 {  
  local i  
   
  for i in $(< /proc/cmdline)  
  do  
  [[ ${i} = $1 ]] && return 0  
  done  
   
  return 1  
 }  
   
54  update_system_settings()  update_system_settings()
55  {  {
56   echo -e ${COLMAGENTA}"Checking system setup ..."${COLDEFAULT}   rc_mecho Checking system setup ...
57    
58   # get the modules settings   # get the modules settings
59   # ! is the first thing that must be configured !   # ! is the first thing that must be configured !
# Line 125  get_system_serial() Line 112  get_system_serial()
112   CUR_MAC=$(ifconfig ${ALX_IFACE} | grep HWaddr | cut -d ' ' -f11)   CUR_MAC=$(ifconfig ${ALX_IFACE} | grep HWaddr | cut -d ' ' -f11)
113   CUR_MTIME=$(date +%s)   CUR_MTIME=$(date +%s)
114    
115   echo -e ${COLOREDSTAR} "Trying to validate my serial ..."   rc_print "Trying to validate my serial ..."
116    
117   # nice serial output   # nice serial output
118   $CURS_UP   $CURS_UP
# Line 148  get_system_serial() Line 135  get_system_serial()
135   echo   echo
136   if [[ ${ALX_FORCED_RECHECK} = true ]]   if [[ ${ALX_FORCED_RECHECK} = true ]]
137   then   then
138   echo -e ${COLMAGENTA}"Hardware autodetection forced by system-administrator"${COLDEFAULT}   rc_mecho "Hardware autodetection forced by system-administrator"
139   # always disable CONFD_NETWORKING here   # always disable CONFD_NETWORKING here
140   export ALX_CONFD_NETWORKING="false"   export ALX_CONFD_NETWORKING="false"
141   else   else
142   echo -e ${COLMAGENTA}"Preparing system for first boot"${COLDEFAULT}   rc_mecho "Preparing system for first boot"
143   fi   fi
144   ALX_HW_DETECT=true   ALX_HW_DETECT=true
145   hwsetup   hwsetup
# Line 177  get_system_serial() Line 164  get_system_serial()
164   exit 1   exit 1
165   fi   fi
166    
167    
168   CUR_IP=$(/sbin/ifconfig eth0 | sed -n '/addr:/s/ [^r]*..//gp')   CUR_IP=$(/sbin/ifconfig eth0 | sed -n '/addr:/s/ [^r]*..//gp')
169   CUR_MAC=$(/sbin/ifconfig eth0 | grep HWaddr | cut -d ' ' -f11)   CUR_MAC=$(/sbin/ifconfig eth0 | grep HWaddr | cut -d ' ' -f11)
170   CUR_MTIME=$(date +%s)   CUR_MTIME=$(date +%s)
# Line 187  get_system_serial() Line 175  get_system_serial()
175   # but first check the serial   # but first check the serial
176   source /etc/alxconfig-ng/serial   source /etc/alxconfig-ng/serial
177    
178   echo -e ${COLOREDSTAR} "Trying to validate my serial ..."   rc_print "Trying to validate my serial ..."
179    
180   # nice serial output   # nice serial output
181   $CURS_UP   $CURS_UP
# Line 215  get_system_serial() Line 203  get_system_serial()
203   return 0   return 0
204   fi   fi
205    
206   echo -e ${COLOREDSTAR} "Trying to get new serial ..."   rc_print "Trying to get new serial ..."
207    
208   # 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)
209   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 287  import_settings_to_db() Line 275  import_settings_to_db()
275   source /etc/conf.d/hwsetup/mouse   source /etc/conf.d/hwsetup/mouse
276    
277   echo   echo
278   echo -e ${COLMAGENTA}"Importing detected settings to database"${COLDEFAULT}   rc_mecho "Importing detected settings to database"
279    
280   # network   # network
281   echo -e "      Network settings ..."   rc_mecho "      Network settings ..."
282   if [[ ${ALX_CONFD_NETWORKING} = true ]]   if [[ ${ALX_CONFD_NETWORKING} = true ]]
283   then   then
284   # get settings   # get settings
  #source ${rc_base}/init.d/network &> /dev/null  
285   for iface in $(onboot_interface_list ${network_settings}/net.*)   for iface in $(onboot_interface_list ${network_settings}/net.*)
286   do   do
287   [[ $(< ${SETTINGSPATH}/confd-networking) != ${iface} ]] && continue   [[ $(< ${SETTINGSPATH}/confd-networking) != ${iface} ]] && continue
288   echo "WARNING: only importing settings for interface [ ${iface} ] !"   rc_echo "WARNING: only importing settings for interface [ ${iface} ] !"
289   source ${network_settings}/net.${iface} || exit 1   source ${network_settings}/net.${iface} || echo "Error: could not read '${network_settings}/net.${iface}'"
290   NETCARD_DRIVER="$(cat /etc/modules.d/net.${iface} | cut -d' ' -f3)"   NETCARD_DRIVER="$(cat /etc/modprobe.d/net.${iface}.conf | cut -d' ' -f3)"
291    
292   mysqldo "insert into cfg_network(   mysqldo "insert into cfg_network(
293   hostname,   hostname,
# Line 371  import_settings_to_db() Line 358  import_settings_to_db()
358   evaluate_retval   evaluate_retval
359    
360   # xserver   # xserver
361   echo -e "      Graphic settings ..."   rc_mecho "      Graphic settings ..."
362   # xserver general   # xserver general
363   ( mysqldo "insert into cfg_graphic(   ( mysqldo "insert into cfg_graphic(
364   serial,   serial,
# Line 390  import_settings_to_db() Line 377  import_settings_to_db()
377   evaluate_retval   evaluate_retval
378    
379   # input   # input
380   echo -e "      Input settings ..."   rc_mecho "      Input settings ..."
381   mysqldo "insert into cfg_input(serial,mouse) values('${ALX_SERIAL}','${XMOUSETYPE}');"   mysqldo "insert into cfg_input(serial,mouse) values('${ALX_SERIAL}','${XMOUSETYPE}');"
382   evaluate_retval   evaluate_retval
383    
384   # auth   # auth
385   echo -e "      Authentification settings ..."   rc_mecho "      Authentification settings ..."
386   mysqldo "insert into client_auth(   mysqldo "insert into client_auth(
387   serial,   serial,
388   username,   username,
# Line 416  import_settings_to_db() Line 403  import_settings_to_db()
403    
404   # exchange ssh rsa keys - the first boot needs this !   # exchange ssh rsa keys - the first boot needs this !
405   # or no reboot will work via the webadmin   # or no reboot will work via the webadmin
406   echo -e "      SSH authentification settings ..."   rc_mecho "      SSH authentification settings ..."
407   HOME=/root config_ssh_auth   HOME=/root config_ssh_auth
408   evaluate_retval   evaluate_retval
409    
410   # autostart   # autostart
411   echo -e "      Autostart settings ..."   rc_mecho "      Autostart settings ..."
412   mysqldo "insert into cfg_autostart(serial,session) values('${ALX_SERIAL}','');"   mysqldo "insert into cfg_autostart(serial,session) values('${ALX_SERIAL}','');"
413    
414   # screensaver   # screensaver
415   echo -e "      Screensaver settings ..."   rc_mecho "      Screensaver settings ..."
416   mysqldo "insert into cfg_screensaver(serial,screensaver) values('${ALX_SERIAL}','')"   mysqldo "insert into cfg_screensaver(serial,screensaver) values('${ALX_SERIAL}','')"
417    
418   # version info   # version info
419     rc_mecho "      OS version info ..."
420   local alx_os   local alx_os
421   local alx_utils   local alx_utils
422   alx_os="$(< /etc/mageversion)"   alx_os="$(< /etc/mageversion)"
# Line 460  update_settings_in_db() Line 448  update_settings_in_db()
448   source /etc/conf.d/hwsetup/mouse   source /etc/conf.d/hwsetup/mouse
449    
450   echo   echo
451   echo -e ${COLMAGENTA}"Updating detected settings in database"${COLDEFAULT}   rc_mecho "Updating detected settings in database"
452    
453   # network   # network
454   echo -e "      Network settings ..."   rc_mecho "      Network settings ..."
455   if [[ ${ALX_CONFD_NETWORKING} = true ]]   if [[ ${ALX_CONFD_NETWORKING} = true ]]
456   then   then
457   # get settings   # get settings
# Line 471  update_settings_in_db() Line 459  update_settings_in_db()
459   for iface in $(onboot_interface_list ${network_settings}/net.*)   for iface in $(onboot_interface_list ${network_settings}/net.*)
460   do   do
461   [[ $(< ${SETTINGSPATH}/confd-networking) != ${iface} ]] && continue   [[ $(< ${SETTINGSPATH}/confd-networking) != ${iface} ]] && continue
462   echo "WARNING: only importing settings for interface [ ${iface} ] !"   rc_echo "WARNING: only importing settings for interface [ ${iface} ] !"
463   source ${network_settings}/net.${iface} || exit 1   source ${network_settings}/net.${iface} || exit 1
464   NETCARD_DRIVER="$(cat /etc/modules.d/net.${iface} | cut -d' ' -f3)"   NETCARD_DRIVER="$(cat /etc/modprobe.d/net.${iface}.conf | cut -d' ' -f3)"
465    
466   mysqldo "update cfg_network set   mysqldo "update cfg_network set
467   hostname='${ALX_DEFAULT_HOSTNAME}',   hostname='${ALX_DEFAULT_HOSTNAME}',
# Line 512  update_settings_in_db() Line 500  update_settings_in_db()
500   evaluate_retval   evaluate_retval
501    
502   # xserver   # xserver
503   echo -e "      Graphic settings ..."   rc_mecho "      Graphic settings ..."
504   # xserver general   # xserver general
505   mysqldo "update cfg_graphic set   mysqldo "update cfg_graphic set
506   module='${XMODULE}',   module='${XMODULE}',
# Line 523  update_settings_in_db() Line 511  update_settings_in_db()
511   evaluate_retval   evaluate_retval
512    
513   # input   # input
514   echo -e "      Input settings ..."   rc_mecho "      Input settings ..."
515   mysqldo "update cfg_input set mouse='${XMOUSETYPE}' where serial=${ALX_SERIAL};"   mysqldo "update cfg_input set mouse='${XMOUSETYPE}' where serial=${ALX_SERIAL};"
516   evaluate_retval   evaluate_retval
517    
518   # version info   # version info
519     rc_mecho "      OS version info ..."
520   local alx_os   local alx_os
521   local alx_utils   local alx_utils
522   alx_os="$(< /etc/mageversion)"   alx_os="$(< /etc/mageversion)"
# Line 556  import_settings_local() Line 545  import_settings_local()
545   source /etc/conf.d/hwsetup/knoppix   source /etc/conf.d/hwsetup/knoppix
546    
547   echo   echo
548   echo -e ${COLMAGENTA}"Importing detected settings to local system"${COLDEFAULT}   rc_mecho "Importing detected settings to local system"
549    
550   if [[ ${ALX_CONFD_NETWORKING} = false ]]   if [[ ${ALX_CONFD_NETWORKING} = false ]]
551   then   then
552   #[ ! -d ${SETTINGSPATH} ] && install -d ${SETTINGSPATH}   # set an device alias for modprobe.conf
  #echo "${NETCARD_DRIVER}" > ${SETTINGSPATH}/modules  
   
  # set an device alias for modprobe.conf and modules.conf  
  [ ! -d /etc/modules.d ] && install -d /etc/modules.d  
553   [ ! -d /etc/modprobe.d ] && install -d /etc/modprobe.d   [ ! -d /etc/modprobe.d ] && install -d /etc/modprobe.d
554   echo "alias eth0 ${NETCARD_DRIVER}" > /etc/modules.d/net.eth0   echo "alias eth0 ${NETCARD_DRIVER}" > /etc/modprobe.d/net.eth0.conf
  echo "alias eth0 ${NETCARD_DRIVER}" > /etc/modprobe.d/net.eth0  
555    
556   # regenerate modprobe.conf   # regenerate modprobe.conf
557   [ -x $(which modules-update) ] && modules-update || echo "cannot regen modprobe.conf"   [ -x $(which modules-update) ] && modules-update || rc_echo "modules-update not found!"
558   evaluate_retval   evaluate_retval
559   fi   fi
560    
# Line 590  import_settings_local() Line 574  import_settings_local()
574   # now generate fluxbox config files   # now generate fluxbox config files
575    
576   # fluxbox main config   # fluxbox main config
577   cat ${ALX_SKELETONS}/fluxbox/init \   local fbinit
578   > ${ALX_UNPRIV_HOME}/.fluxbox/init   if [ -f ${ALX_SKELETONS}/fluxbox/init ]
579     then
580     fbinit="${ALX_SKELETONS}/fluxbox/init"
581     else
582     fbinit="/usr/share/fluxbox/init"
583     fi
584     cat ${fbinit} > ${ALX_UNPRIV_HOME}/.fluxbox/init
585    
586   # fluxbox autostart   # fluxbox autostart
587   cat ${ALX_SKELETONS}/fluxbox/apps \   CONFIG="${ALX_UNPRIV_HOME}/.fluxbox/apps"
588   > ${ALX_UNPRIV_HOME}/.fluxbox/apps   # do not show decorations on messages generated with xmessage
589     if [ -x /usr/bin/xmessage ]
590     then
591     addconfig '[app] (xmessage)'
592     addconfig ' [Deco] {NONE}'
593     addconfig '[end]'
594     fi
595     # add icon utility
596     [ -x /usr/bin/idesk ] && addconfig '[startup] {nohup idesk > /dev/null &}'
597     # add numlock utility
598     [ -x /usr/bin/numlockx ] && addconfig '[startup] {nohup numlockx on &}'
599    
600     # fluxbox hotkeys
601     local fbkeys
602     if [ -f ${ALX_SKELETONS}/fluxbox/keys ]
603     then
604     fbkeys="${ALX_SKELETONS}/fluxbox/keys"
605     else
606     fbkeys="/usr/share/fluxbox/keys"
607     fi
608     cat ${fbkeys} > ${ALX_UNPRIV_HOME}/.fluxbox/keys
609    
610   # fluxbox menu header   # fluxbox menu header
611   cat ${ALX_SKELETONS}/fluxbox/menu.header \   cat ${ALX_SKELETONS}/fluxbox/menu.header > ${ALX_UNPRIV_HOME}/.fluxbox/menu
  > ${ALX_UNPRIV_HOME}/.fluxbox/menu  
612    
613   # now fix it with proper messages :P   # now fix it with proper messages :P
614   local ver="$(< /etc/mageversion)"   local ver="$(< /etc/mageversion)"
615   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  
616    
617   # add a newline (maybe there is no crlf in the header)   # add a newline (maybe there is no crlf in the header)
618   echo >> ${ALX_UNPRIV_HOME}/.fluxbox/menu   echo >> ${ALX_UNPRIV_HOME}/.fluxbox/menu
619    
620   # fluxbox menu footer   # fluxbox menu footer
621   cat ${ALX_SKELETONS}/fluxbox/menu.footer \   cat ${ALX_SKELETONS}/fluxbox/menu.footer >> ${ALX_UNPRIV_HOME}/.fluxbox/menu
  >> ${ALX_UNPRIV_HOME}/.fluxbox/menu  
622    
623   # add a newline (maybe there is no crlf in the footer)   # add a newline (maybe there is no crlf in the footer)
624   echo >> ${ALX_UNPRIV_HOME}/.fluxbox/menu   echo >> ${ALX_UNPRIV_HOME}/.fluxbox/menu
625    
   
626   # setup some standart icons (sysinfo.lnk)   # setup some standart icons (sysinfo.lnk)
  # basic config  
  cat ${ALX_SKELETONS}/xtdesktop/xtdeskrc > ${ALX_UNPRIV_HOME}/.xtdeskrc  
   
627   # clean desktop icon location   # clean desktop icon location
628   [ -d ${ALX_UNPRIV_HOME}/.xtdesktop ] && rm -rf ${ALX_UNPRIV_HOME}/.xtdesktop   [ -d ${ALX_UNPRIV_HOME}/.idesktop ] && rm -rf ${ALX_UNPRIV_HOME}/.idesktop
629   install -d ${ALX_UNPRIV_HOME}/.xtdesktop   install -d ${ALX_UNPRIV_HOME}/.idesktop
630    
631     # add shutdown, reboot icons
632     local name
633     # default settings
634     declare -i x=30
635     declare -i y=30
636     for i in shutdown reboot
637     do
638     case ${i} in
639     shutdown) name="Herunterfahren"
640     reboot) name="Neustarten"
641     esac
642    
643     generate_icon \
644     --name "${name}" \
645     --command "/usr/lib/alxconfig-ng/bin/user_${i}.sh" \
646     --icon "${ALX_SESSIONS_ICONS}/${i}.png" \
647     --dest "${dest}/${i}.lnk" \
648     --xres "${x}" \
649     --yres "${y}"
650    
651     y=$((${y} + 80))
652     done
653    
654   # last but not least gen a icon with some sys informations   # last but not least gen a icon with some sys informations
655   local sysinfo   local sysinfo
# Line 645  import_settings_local() Line 671  import_settings_local()
671   --name "${sysinfo}" \   --name "${sysinfo}" \
672   --command "exit 0" \   --command "exit 0" \
673   --icon "${ALX_SESSIONS_ICONS}/sysinfo.png" \   --icon "${ALX_SESSIONS_ICONS}/sysinfo.png" \
674   --dest "${ALX_UNPRIV_HOME}/.xtdesktop/sysinfo.lnk" \   --dest "${ALX_UNPRIV_HOME}/.idesktop/sysinfo.lnk" \
675   --xres "${xres}" \   --xres "${xres}" \
676   --yres "${yres}" \   --yres "${yres}" \
677   --icon-width "1" \   --icon-width "1" \
678   --icon-height "1"   --icon-height "1"
679    
  # create a xinitrc  
  echo "exec startfluxbox" > ${ALX_UNPRIV_HOME}/.xinitrc  
   
680   # set correct permissions   # set correct permissions
681   chown ${ALX_UNPRIV_USER}:${ALX_UNPRIV_GROUP} ${ALX_UNPRIV_HOME}   chown ${ALX_UNPRIV_USER}:${ALX_UNPRIV_GROUP} ${ALX_UNPRIV_HOME}
682   chown ${ALX_UNPRIV_USER}:${ALX_UNPRIV_GROUP} ${ALX_UNPRIV_HOME}/.fluxbox   chown ${ALX_UNPRIV_USER}:${ALX_UNPRIV_GROUP} ${ALX_UNPRIV_HOME}/.fluxbox
683   chmod 0755 ${ALX_UNPRIV_HOME}/.fluxbox   chmod 0755 ${ALX_UNPRIV_HOME}/.fluxbox
684   chmod 0755 ${ALX_UNPRIV_HOME}/.xtdesktop   chmod 0755 ${ALX_UNPRIV_HOME}/.idesktop
685   chmod 0644 ${ALX_UNPRIV_HOME}/.xtdeskrc   if [ -f ${ALX_UNPRIV_HOME}/.ideskrc ]
686   chmod 0644 ${ALX_UNPRIV_HOME}/.xinitrc   then
687     chmod 0644 ${ALX_UNPRIV_HOME}/.ideskrc
688     fi
689  }  }
690    
691  # start|stop  # start|stop
692  preliminary_network()  preliminary_network()
693  {  {
694   local module   local module
  local modulesconf  
695    
696   if [ -f /etc/alxconfig-ng/state/configured ]   if [ -f /etc/alxconfig-ng/state/configured ]
697   then   then
# Line 679  preliminary_network() Line 703  preliminary_network()
703   modprobe ${module}   modprobe ${module}
704   fi   fi
705    
  # check modprobe.conf  
  if [[ $(kernel_major_version) = 2.4 ]]  
  then  
  modulesconf="/etc/modules.conf"  
  else  
  modulesconf="/etc/modprobe.conf"  
  fi  
  if [[ -z $(grep eth0 ${modulesconf}) ]]  
  then  
  modules-update force  
  fi  
706   else   else
707   # vars used by hwsetup   # vars used by hwsetup
708   local NETCARD_FULLNAME NETCARD_DRIVER MOUSE_FULLNAME MOUSE_DEVICE SOUND_FULLNAME   local NETCARD_FULLNAME NETCARD_DRIVER MOUSE_FULLNAME MOUSE_DEVICE SOUND_FULLNAME
# Line 705  preliminary_network() Line 718  preliminary_network()
718   # keeping like always safe:   # keeping like always safe:
719   # no network should be startet here,   # no network should be startet here,
720   # so we can delete all pid files if one exists   # so we can delete all pid files if one exists
721   if ps -A|grep udhcpc > /dev/null   if [[ ! -z $(pidof $(basename ${ALX_DHCP_PROG})) ]]
722   then   then
723   echo -e ${COLMAGENTA}"Forcing network down"${COLDEFAULT}   rc_mecho "Forcing network down"
724   killall udhcpc   killall $(basename ${ALX_DHCP_PROG}) &> /dev/null
725   sleep 1   sleep 1
726   fi   fi
727   [[ ${ALX_CONFD_NETWORKING} = true ]] && [[ ${RUNLEVEL} != S ]] && \   [[ ${ALX_CONFD_NETWORKING} = true ]] && ${rc_base}/init.d/network stop
  ${rc_base}/init.d/network stop  
728    
729   echo -e ${COLMAGENTA}"Starting preliminary networking ... "${COLDEFAULT}   rc_mecho "Starting preliminary networking ... "
730    
731   # start network configured from /etc/conf.d   # start network configured from /etc/conf.d
732   if [[ ${ALX_CONFD_NETWORKING} = true ]]   if [[ ${ALX_CONFD_NETWORKING} = true ]]
733   then   then
734   ${rc_base}/init.d/network start   ${rc_base}/init.d/network start
735   else   else
736   echo -e ${COLOREDSTAR}"Starting default dhcp based networking ... "${COLDEFAULT}   rc_print "Starting default dhcp based networking ... "
737   # -t 10 timeout of 10 secs   ${ALX_DHCP_PROG} ${ALX_DHCP_START} &> /dev/null
  dhcpcd -t 10 &> /dev/null  
738   evaluate_retval   evaluate_retval
739   fi   fi
740   ;;   ;;
741    
742   stop)   stop)
743   echo -e ${COLMAGENTA}"Stopping preliminary networking ... "${COLDEFAULT}   rc_mecho "Stopping preliminary networking ... "
744   if [[ ${ALX_CONFD_NETWORKING} = true ]]   if [[ ${ALX_CONFD_NETWORKING} = true ]]
745   then   then
746   ${rc_base}/init.d/network stop   ${rc_base}/init.d/network stop
747   else   else
748   echo -e ${COLOREDSTAR}"Stopping default dhcp based networking ... "${COLDEFAULT}   rc_print "Stopping default dhcp based networking ... "
749   ifconfig eth0 down   ifconfig ${ALX_IFACE} down
750   fi   fi
751   if ps -A|grep dhcpcd > /dev/null   if [[ ! -z $(pidof $(basename ${ALX_DHCP_PROG})) ]]
752   then   then
753   dhcpcd -z  &> /dev/null   killall $(basename ${ALX_DHCP_PROG}) &> /dev/null
754   sleep 1   sleep 1
755   fi   fi
756   evaluate_retval   evaluate_retval
# Line 755  reset_system_settings() Line 766  reset_system_settings()
766  {  {
767   # force load of de kbdkeys   # force load of de kbdkeys
768   loadkeys -q de   loadkeys -q de
769   echo   rc_echo
770   echo -en ${COLRED}   rc_echo -en ${COLRED}
771   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!"
772   echo -e ${COLDEFAULT}   rc_echo -e ${COLDEFAULT}
773   echo "*** Do you really want to continue ?"   rc_echo "*** Do you really want to continue ?"
774   echo -n "*** Enter 'yes' to continue, anything else to abort: "   rc_echo -n "*** Enter 'yes' to continue, anything else to abort: "
775   read kbinsert   read kbinsert
776   if [[ ${kbinsert} = yes ]]   if [[ ${kbinsert} = yes ]]
777   then   then
778   echo -en ${COLRED}   rc_echo -en ${COLRED}
779   echo -n "*** OK, you really want it ... killing all settings: "   rc_echo -n "*** OK, you really want it ... killing all settings: "
780   for i in 3 2 1 now   for i in 3 2 1 now
781   do   do
782   echo -n " ${i}"   rc_echo -n " ${i}"
783   sleep 1   sleep 1
784   done   done
785   echo -e ${COLDEFAULT}   rc_echo -e ${COLDEFAULT}
786    
787   ## reset all settings:   ## reset all settings:
788   rm -rf ${SETTINGSPATH}/*   rm -rf ${SETTINGSPATH}/*
# Line 779  reset_system_settings() Line 790  reset_system_settings()
790   rm -rf /etc/alxconfig-ng/state   rm -rf /etc/alxconfig-ng/state
791    
792   # clear all printers & net-shares   # clear all printers & net-shares
793   :> /etc/cups/printers.conf   :> /etc/printcap
  :> /etc/samba/smb.conf  
794    
795   # remove inetd, cups & smb from init   # remove lprng
796   rc-config del inetd &> /dev/null   rc-config del lprng &> /dev/null
  rc-config del cups &> /dev/null  
  rc-config del samba &> /dev/null  
797    
798   # remove all user settings   # remove all user settings
799   [ -d ${ALX_UNPRIV_HOME} ] && rm -rf ${ALX_UNPRIV_HOME}   [ -d ${ALX_UNPRIV_HOME} ] && rm -rf ${ALX_UNPRIV_HOME}
# Line 795  reset_system_settings() Line 803  reset_system_settings()
803    
804   # remove all old nics and modules configs   # remove all old nics and modules configs
805   find /etc/conf.d -type f -name 'net.*' | xargs rm   find /etc/conf.d -type f -name 'net.*' | xargs rm
806   find /etc/modules.d -type f -name 'net.*' | xargs rm   find /etc/modprobe.d -type f -name 'net.*' | xargs rm
807    
808   # restore default networking   # restore default networking
809   cat ${ALX_SKELETONS}/net/net.eth0 > /etc/conf.d/net.eth0   cat ${ALX_SKELETONS}/net/net.eth0 > /etc/conf.d/net.eth0
810    
811   echo "I am done now, press [Enter] to reboot system ..."   rc_echo "I am done now, press [Enter] to reboot system ..."
812   else   else
813   echo "Aborted, press [Enter] to reboot system ..."   rc_echo "Aborted, press [Enter] to reboot system ..."
814   fi   fi
815   read   read
816   reboot   reboot
# Line 930  case $1 in Line 938  case $1 in
938   [ -f /etc/alxconfig-ng/state/state ] && rm /etc/alxconfig-ng/state/state   [ -f /etc/alxconfig-ng/state/state ] && rm /etc/alxconfig-ng/state/state
939   sleep 0.1   sleep 0.1
940   ;;   ;;
941    
942   *)   *)
943   echo "Usage: $0 {start|stop} ..."   echo "Usage: $0 {start|stop} ..."
944   ;;   ;;
945  esac  esac
   

Legend:
Removed from v.2010  
changed lines
  Added in v.2477