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_20060908/init.d/alxsettings revision 1622 by niro, Thu Dec 9 09:06:33 2010 UTC alx-src/branches/alxconf-060/init.d/alxsettings revision 2010 by niro, Mon May 9 15:44:33 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
# Line 39  source /usr/lib/alxconfig-ng/functions/c Line 37  source /usr/lib/alxconfig-ng/functions/c
37  source /usr/lib/alxconfig-ng/functions/config_ssh_auth  source /usr/lib/alxconfig-ng/functions/config_ssh_auth
38  source /usr/lib/alxconfig-ng/functions/config_versions  source /usr/lib/alxconfig-ng/functions/config_versions
39    
 # check if mysql is available  
 [ -x /usr/bin/mysql ] && MYSQL_ALX=true  
   
40  # other needed vars  # other needed vars
41  ALX_HW_DETECT=false  ALX_HW_DETECT=false
42  ALX_FORCED_RECHECK=false  ALX_FORCED_RECHECK=false
# Line 126  get_system_serial() Line 121  get_system_serial()
121   exit 1   exit 1
122   fi   fi
123    
124   CUR_IP=$(/sbin/ifconfig ${ALX_IFACE} | sed -n '/addr:/s/ [^r]*..//gp')   CUR_IP=$(ifconfig ${ALX_IFACE} | sed -n '/addr:/s/ [^r]*..//gp')
125   CUR_MAC=$(/sbin/ifconfig ${ALX_IFACE} | grep HWaddr | cut -d ' ' -f11)   CUR_MAC=$(ifconfig ${ALX_IFACE} | grep HWaddr | cut -d ' ' -f11)
126   CUR_MTIME=$(date +%s)   CUR_MTIME=$(date +%s)
127    
128   echo -e ${COLOREDSTAR} "Trying to validate my serial ..."   echo -e ${COLOREDSTAR} "Trying to validate my serial ..."
# Line 160  get_system_serial() Line 155  get_system_serial()
155   echo -e ${COLMAGENTA}"Preparing system for first boot"${COLDEFAULT}   echo -e ${COLMAGENTA}"Preparing system for first boot"${COLDEFAULT}
156   fi   fi
157   ALX_HW_DETECT=true   ALX_HW_DETECT=true
158   /etc/init.d/hwdetect start   hwsetup
159    
160   # set hostname to alx_default_hostname   # set hostname to alx_default_hostname
161   # use old hostname if this is a forced re-check   # use old hostname if this is a forced re-check
# Line 282  import_settings_to_db() Line 277  import_settings_to_db()
277   [ -z "${ALX_DEFAULT_DOMAIN}" ] && ALX_DEFAULT_DOMAIN=localdomain   [ -z "${ALX_DEFAULT_DOMAIN}" ] && ALX_DEFAULT_DOMAIN=localdomain
278   [ -z "${ALX_DEFAULT_HOSTNAME}" ] && ALX_DEFAULT_HOSTNAME=magellan-alx   [ -z "${ALX_DEFAULT_HOSTNAME}" ] && ALX_DEFAULT_HOSTNAME=magellan-alx
279    
280   # vars used by hwdetect   # vars used by hwsetup
281   local NETCARD_FULLNAME NETCARD_DRIVER MOUSE_FULLNAME MOUSE_DEVICE SOUND_FULLNAME   local NETCARD_FULLNAME NETCARD_DRIVER MOUSE_FULLNAME MOUSE_DEVICE SOUND_FULLNAME
282   local SOUND_DRIVER XSERVER XMODULE XDESC FLOPPY_FULLNAME FLOPPY_DEVICE FLOPPY_DRIVER   local SOUND_DRIVER XSERVER XMODULE XDESC FLOPPY_FULLNAME FLOPPY_DEVICE FLOPPY_DRIVER
283   local MOUSETYPE XMOUSETYPE FULLNAME DEVICE   local MOUSETYPE XMOUSETYPE FULLNAME DEVICE
284    
285   # get setting from hwdetect   # get setting from hwsetup
286   source /etc/sysconfig/hwsetup/knoppix   source /etc/conf.d/hwsetup/knoppix
287   source /etc/sysconfig/hwsetup/mouse   source /etc/conf.d/hwsetup/mouse
288    
289   echo   echo
290   echo -e ${COLMAGENTA}"Importing detected settings to database"${COLDEFAULT}   echo -e ${COLMAGENTA}"Importing detected settings to database"${COLDEFAULT}
# Line 455  update_settings_in_db() Line 450  update_settings_in_db()
450   [ -z "${ALX_DEFAULT_DOMAIN}" ] && ALX_DEFAULT_DOMAIN=localdomain   [ -z "${ALX_DEFAULT_DOMAIN}" ] && ALX_DEFAULT_DOMAIN=localdomain
451   [ -z "${ALX_DEFAULT_HOSTNAME}" ] && ALX_DEFAULT_HOSTNAME=magellan-alx   [ -z "${ALX_DEFAULT_HOSTNAME}" ] && ALX_DEFAULT_HOSTNAME=magellan-alx
452    
453   # vars used by hwdetect   # vars used by hwsetup
454   local NETCARD_FULLNAME NETCARD_DRIVER MOUSE_FULLNAME MOUSE_DEVICE SOUND_FULLNAME   local NETCARD_FULLNAME NETCARD_DRIVER MOUSE_FULLNAME MOUSE_DEVICE SOUND_FULLNAME
455   local SOUND_DRIVER XSERVER XMODULE XDESC FLOPPY_FULLNAME FLOPPY_DEVICE FLOPPY_DRIVER   local SOUND_DRIVER XSERVER XMODULE XDESC FLOPPY_FULLNAME FLOPPY_DEVICE FLOPPY_DRIVER
456   local MOUSETYPE XMOUSETYPE FULLNAME DEVICE   local MOUSETYPE XMOUSETYPE FULLNAME DEVICE
457    
458   # get setting from hwdetect   # get setting from hwsetup
459   source /etc/sysconfig/hwsetup/knoppix   source /etc/conf.d/hwsetup/knoppix
460   source /etc/sysconfig/hwsetup/mouse   source /etc/conf.d/hwsetup/mouse
461    
462   echo   echo
463   echo -e ${COLMAGENTA}"Updating detected settings in database"${COLDEFAULT}   echo -e ${COLMAGENTA}"Updating detected settings in database"${COLDEFAULT}
# Line 552  import_settings_local() Line 547  import_settings_local()
547   [ -z "${ALX_DEFAULT_DOMAIN}" ] && ALX_DEFAULT_DOMAIN=localdomain   [ -z "${ALX_DEFAULT_DOMAIN}" ] && ALX_DEFAULT_DOMAIN=localdomain
548   [ -z "${ALX_DEFAULT_HOSTNAME}" ] && ALX_DEFAULT_HOSTNAME=magellan-alx   [ -z "${ALX_DEFAULT_HOSTNAME}" ] && ALX_DEFAULT_HOSTNAME=magellan-alx
549    
550   # vars used by hwdetect   # vars used by hwsetup
551   local NETCARD_FULLNAME NETCARD_DRIVER MOUSE_FULLNAME MOUSE_DEVICE SOUND_FULLNAME   local NETCARD_FULLNAME NETCARD_DRIVER MOUSE_FULLNAME MOUSE_DEVICE SOUND_FULLNAME
552   local SOUND_DRIVER XSERVER XMODULE XDESC FLOPPY_FULLNAME FLOPPY_DEVICE FLOPPY_DRIVER   local SOUND_DRIVER XSERVER XMODULE XDESC FLOPPY_FULLNAME FLOPPY_DEVICE FLOPPY_DRIVER
553   local MOUSETYPE XMOUSETYPE FULLNAME DEVICE   local MOUSETYPE XMOUSETYPE FULLNAME DEVICE
554    
555   # get setting from hwdetect   # get setting from hwsetup
556   source /etc/sysconfig/hwsetup/knoppix   source /etc/conf.d/hwsetup/knoppix
557    
558   echo   echo
559   echo -e ${COLMAGENTA}"Importing detected settings to local system"${COLDEFAULT}   echo -e ${COLMAGENTA}"Importing detected settings to local system"${COLDEFAULT}
# Line 582  import_settings_local() Line 577  import_settings_local()
577   # set system state to 'already configured'   # set system state to 'already configured'
578   touch /etc/alxconfig-ng/state/configured   touch /etc/alxconfig-ng/state/configured
579    
580     # install slim desktopmanager configuration
581     config_display_manager
582    
583   # if only an recheck was forced than abort now   # if only an recheck was forced than abort now
584   [[ ${ALX_FORCED_RECHECK} = true ]] && return 0   [[ ${ALX_FORCED_RECHECK} = true ]] && return 0
585    
# Line 669  import_settings_local() Line 667  import_settings_local()
667  preliminary_network()  preliminary_network()
668  {  {
669   local module   local module
670     local modulesconf
671    
672   if [ -f /etc/alxconfig-ng/state/configured ]   if [ -f /etc/alxconfig-ng/state/configured ]
673   then   then
# Line 679  preliminary_network() Line 678  preliminary_network()
678   module=$(cat ${SETTINGSPATH}/modules)   module=$(cat ${SETTINGSPATH}/modules)
679   modprobe ${module}   modprobe ${module}
680   fi   fi
681    
682     # check modprobe.conf
683     if [[ $(kernel_major_version) = 2.4 ]]
684     then
685     modulesconf="/etc/modules.conf"
686     else
687     modulesconf="/etc/modprobe.conf"
688     fi
689     if [[ -z $(grep eth0 ${modulesconf}) ]]
690     then
691     modules-update force
692     fi
693   else   else
694   # vars used by hwdetect   # vars used by hwsetup
695   local NETCARD_FULLNAME NETCARD_DRIVER MOUSE_FULLNAME MOUSE_DEVICE SOUND_FULLNAME   local NETCARD_FULLNAME NETCARD_DRIVER MOUSE_FULLNAME MOUSE_DEVICE SOUND_FULLNAME
696   local SOUND_DRIVER XSERVER XMODULE XDESC FLOPPY_FULLNAME FLOPPY_DEVICE FLOPPY_DRIVER   local SOUND_DRIVER XSERVER XMODULE XDESC FLOPPY_FULLNAME FLOPPY_DEVICE FLOPPY_DRIVER
697    
698   # get setting from hwdetect   # get setting from hwsetup
699   source /etc/sysconfig/hwsetup/knoppix   source /etc/conf.d/hwsetup/knoppix
700   modprobe ${NETCARD_DRIVER}   modprobe ${NETCARD_DRIVER}
701   fi   fi
702    
# Line 694  preliminary_network() Line 705  preliminary_network()
705   # keeping like always safe:   # keeping like always safe:
706   # no network should be startet here,   # no network should be startet here,
707   # so we can delete all pid files if one exists   # so we can delete all pid files if one exists
708   if ps -A|grep dhcpcd > /dev/null   if ps -A|grep udhcpc > /dev/null
709   then   then
710   echo -e ${COLMAGENTA}"Forcing network down"${COLDEFAULT}   echo -e ${COLMAGENTA}"Forcing network down"${COLDEFAULT}
711   dhcpcd -k   killall udhcpc
712   sleep 1   sleep 1
  else  
  rm -f /var/run/dhcpcd-eth?.pid  
713   fi   fi
714   [[ ${ALX_CONFD_NETWORKING} = true ]] && [[ ${RUNLEVEL} != S ]] && \   [[ ${ALX_CONFD_NETWORKING} = true ]] && [[ ${RUNLEVEL} != S ]] && \
715   ${rc_base}/init.d/network stop   ${rc_base}/init.d/network stop

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