Magellan Linux

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

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

revision 2038 by niro, Mon May 9 16:01:06 2011 UTC revision 2039 by niro, Wed May 11 09:19:45 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 177  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 560  import_settings_local() Line 562  import_settings_local()
562    
563   if [[ ${ALX_CONFD_NETWORKING} = false ]]   if [[ ${ALX_CONFD_NETWORKING} = false ]]
564   then   then
565   #[ ! -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  
566   [ ! -d /etc/modprobe.d ] && install -d /etc/modprobe.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
  echo "alias eth0 ${NETCARD_DRIVER}" > /etc/modprobe.d/net.eth0  
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"
# Line 590  import_settings_local() Line 587  import_settings_local()
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
# Line 693  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 udhcpc > /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   killall udhcpc &> /dev/null   killall udhcpc &> /dev/null
692   sleep 1   sleep 1
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    
# Line 725  preliminary_network() Line 716  preliminary_network()
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 udhcpc > /dev/null   if [[ ! -z $(pidof udhcpc) ]]
720   then   then
721   killall udhcpc  &> /dev/null   killall udhcpc  &> /dev/null
722   sleep 1   sleep 1
# Line 918  case $1 in Line 909  case $1 in
909   [ -f /etc/alxconfig-ng/state/state ] && rm /etc/alxconfig-ng/state/state   [ -f /etc/alxconfig-ng/state/state ] && rm /etc/alxconfig-ng/state/state
910   sleep 0.1   sleep 0.1
911   ;;   ;;
912    
913   *)   *)
914   echo "Usage: $0 {start|stop} ..."   echo "Usage: $0 {start|stop} ..."
915   ;;   ;;

Legend:
Removed from v.2038  
changed lines
  Added in v.2039