--- alx-src/branches/alxconf-060/init.d/alxsettings 2011/05/09 15:48:19 2011 +++ alx-src/branches/alxconf-060/init.d/alxsettings 2011/05/11 09:19:45 2039 @@ -26,6 +26,7 @@ source /etc/alxconfig-ng/config.rc # helper functions +source /usr/lib/alxconfig-ng/functions/common source /usr/lib/alxconfig-ng/functions/mysqlfunctions source /usr/lib/alxconfig-ng/functions/serial_functions source /usr/lib/alxconfig-ng/functions/config_modules @@ -177,6 +178,7 @@ exit 1 fi + CUR_IP=$(/sbin/ifconfig eth0 | sed -n '/addr:/s/ [^r]*..//gp') CUR_MAC=$(/sbin/ifconfig eth0 | grep HWaddr | cut -d ' ' -f11) CUR_MTIME=$(date +%s) @@ -560,14 +562,9 @@ if [[ ${ALX_CONFD_NETWORKING} = false ]] then - #[ ! -d ${SETTINGSPATH} ] && install -d ${SETTINGSPATH} - #echo "${NETCARD_DRIVER}" > ${SETTINGSPATH}/modules - - # set an device alias for modprobe.conf and modules.conf - [ ! -d /etc/modules.d ] && install -d /etc/modules.d + # set an device alias for modprobe.conf [ ! -d /etc/modprobe.d ] && install -d /etc/modprobe.d - echo "alias eth0 ${NETCARD_DRIVER}" > /etc/modules.d/net.eth0 - echo "alias eth0 ${NETCARD_DRIVER}" > /etc/modprobe.d/net.eth0 + echo "alias eth0 ${NETCARD_DRIVER}" > /etc/modprobe.d/net.eth0.conf # regenerate modprobe.conf [ -x $(which modules-update) ] && modules-update || echo "cannot regen modprobe.conf" @@ -590,28 +587,23 @@ # now generate fluxbox config files # fluxbox main config - cat ${ALX_SKELETONS}/fluxbox/init \ - > ${ALX_UNPRIV_HOME}/.fluxbox/init + cat ${ALX_SKELETONS}/fluxbox/init > ${ALX_UNPRIV_HOME}/.fluxbox/init # fluxbox autostart - cat ${ALX_SKELETONS}/fluxbox/apps \ - > ${ALX_UNPRIV_HOME}/.fluxbox/apps + cat ${ALX_SKELETONS}/fluxbox/apps > ${ALX_UNPRIV_HOME}/.fluxbox/apps # fluxbox menu header - cat ${ALX_SKELETONS}/fluxbox/menu.header \ - > ${ALX_UNPRIV_HOME}/.fluxbox/menu + cat ${ALX_SKELETONS}/fluxbox/menu.header > ${ALX_UNPRIV_HOME}/.fluxbox/menu # now fix it with proper messages :P local ver="$(< /etc/mageversion)" - sed -i "s:@CHANGEME@:alx-${ver} #${ALX_SERIAL}:g" \ - ${ALX_UNPRIV_HOME}/.fluxbox/menu + sed -i "s:@CHANGEME@:alx-${ver} #${ALX_SERIAL}:g" ${ALX_UNPRIV_HOME}/.fluxbox/menu # add a newline (maybe there is no crlf in the header) echo >> ${ALX_UNPRIV_HOME}/.fluxbox/menu # fluxbox menu footer - cat ${ALX_SKELETONS}/fluxbox/menu.footer \ - >> ${ALX_UNPRIV_HOME}/.fluxbox/menu + cat ${ALX_SKELETONS}/fluxbox/menu.footer >> ${ALX_UNPRIV_HOME}/.fluxbox/menu # add a newline (maybe there is no crlf in the footer) echo >> ${ALX_UNPRIV_HOME}/.fluxbox/menu @@ -667,7 +659,6 @@ preliminary_network() { local module - local modulesconf if [ -f /etc/alxconfig-ng/state/configured ] then @@ -679,17 +670,6 @@ modprobe ${module} fi - # 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 else # vars used by hwsetup local NETCARD_FULLNAME NETCARD_DRIVER MOUSE_FULLNAME MOUSE_DEVICE SOUND_FULLNAME @@ -705,14 +685,13 @@ # keeping like always safe: # no network should be startet here, # so we can delete all pid files if one exists - if ps -A|grep udhcpc > /dev/null + if [[ ! -z $(pidof udhcpc) ]] then echo -e ${COLMAGENTA}"Forcing network down"${COLDEFAULT} killall udhcpc &> /dev/null sleep 1 fi - [[ ${ALX_CONFD_NETWORKING} = true ]] && [[ ${RUNLEVEL} != S ]] && \ - ${rc_base}/init.d/network stop + [[ ${ALX_CONFD_NETWORKING} = true ]] && ${rc_base}/init.d/network stop echo -e ${COLMAGENTA}"Starting preliminary networking ... "${COLDEFAULT} @@ -737,9 +716,9 @@ echo -e ${COLOREDSTAR}"Stopping default dhcp based networking ... "${COLDEFAULT} ifconfig eth0 down fi - if ps -A|grep dhcpcd > /dev/null + if [[ ! -z $(pidof udhcpc) ]] then - dhcpcd -z &> /dev/null + killall udhcpc &> /dev/null sleep 1 fi evaluate_retval @@ -930,6 +909,7 @@ [ -f /etc/alxconfig-ng/state/state ] && rm /etc/alxconfig-ng/state/state sleep 0.1 ;; + *) echo "Usage: $0 {start|stop} ..." ;;