diff options
author | orchidman <lesibel@free.fr> | 2011-09-08 00:54:17 +0200 |
---|---|---|
committer | orchidman <lesibel@free.fr> | 2011-09-08 00:54:17 +0200 |
commit | e0aeebd26b839bb97107b59c12be0824fde2149b (patch) | |
tree | 823981b81cee5151b291f9ed37833c20232b3035 /base/aaabasicfs/network | |
parent | 193cc4b8dc316bac10238259f257f857e03533c3 (diff) | |
parent | 8184c1ec04ce5c2f40b872180ebaba0a3f464752 (diff) | |
download | nutyx-pakxe-e0aeebd26b839bb97107b59c12be0824fde2149b.tar.gz nutyx-pakxe-e0aeebd26b839bb97107b59c12be0824fde2149b.tar.bz2 nutyx-pakxe-e0aeebd26b839bb97107b59c12be0824fde2149b.tar.xz nutyx-pakxe-e0aeebd26b839bb97107b59c12be0824fde2149b.zip |
Merge branch 'master' of ssh://kiao.no-ip.info:443/~/pakxe
Diffstat (limited to 'base/aaabasicfs/network')
-rwxr-xr-x | base/aaabasicfs/network | 75 |
1 files changed, 58 insertions, 17 deletions
diff --git a/base/aaabasicfs/network b/base/aaabasicfs/network index ff268b03b..84ce546eb 100755 --- a/base/aaabasicfs/network +++ b/base/aaabasicfs/network @@ -6,22 +6,46 @@ . /etc/sysconfig/rc . $rc_functions -let TIME=30 + +# Network configuration +. /etc/sysconfig/network + +NM_PIDFILE=/var/run/NetworkManager.pid +WICD_PIDFILE= + +let TIME=$NETWORKDELAY case "$1" in start) - if [ -f /usr/share/wicd/daemon/wicd-daemon.py ]; then + if [ "$MANAGER" == "networkmanager" ] && [ -x /usr/sbin/NetworkManager ]; then + boot_mesg "Setting network parameters... " + sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1 + echo_ok + + boot_mesg "Starting NetworkManager daemon..." + loadproc NetworkManager --pid-file $NM_PIDFILE + if [ "${NETWORKWAIT}" == "yes" ]; then + [ -z "${LINKDELAY}" ] && LINKDELAY=10 + boot_mesg "Waiting for network..." + nm-online -q --timeout=$LINKDELAY || nm-online -q -x --timeout=30 + [ "$?" = "0" ] && log_success_msg "Network startup" || log_failure_msg "Network startup" + [ -n "${NETWORKDELAY}" ] && /bin/sleep ${NETWORKDELAY} + fi + + elif [ "$MANAGER" == "wicd" ] && [ -f /usr/share/wicd/daemon/wicd-daemon.py ]; then boot_mesg "Starting the wicd Daemon..." loadproc /usr/share/wicd/daemon/wicd-daemon.py if grep -v ^# /etc/fstab | grep _netdev > /dev/null; then - while ! grep "nameserver" /etc/resolv.conf ; - do - sleep 1 - echo -n . - let TIME=$TIME-1 - if [ $TIME -lt 1 ]; then - boot_mesg "Time out" - echo_failure - exit 1 + while ! grep "nameserver" /etc/resolv.conf ; + do + if [ $TIME -gt 0 ]; then + sleep 1 + echo -n . + let TIME=$TIME-1 + if [ $TIME -lt 1 ]; then + boot_mesg "Time out" + echo_failure + exit 1 + fi fi done boot_mesg "Network successfully configured..." @@ -36,18 +60,35 @@ case "$1" in ;; stop) - if [ -f /usr/share/wicd/daemon/wicd-daemon.py ]; then - boot_mesg "Stopping the wicd Daemon..." - loadproc /usr/share/wicd/daemon/wicd-daemon.py --kill + if [ "$MANAGER" == "networkmanager" ] && [ -x /usr/sbin/NetworkManager ]; then + boot_mesg "Stopping NetworkManager daemon..." + killproc -p $NM_PIDFILE NetworkManager + elif [ "$MANAGER" == "wicd" ] && [ -f /usr/share/wicd/daemon/wicd-daemon.py ]; then + boot_mesg "Stopping the wicd Daemon..." + loadproc /usr/share/wicd/daemon/wicd-daemon.py --kill else if [ -f /etc/rc.d/init.d/iplink ]; then - /etc/rc.d/init.d/iplink stop - fi + /etc/rc.d/init.d/iplink stop + fi + fi + ;; + status) + if [ "$MANAGER" == "networkmanager" ] && [ -x /usr/sbin/NetworkManager ]; then + statusproc -p $NM_PIDFILE NetworkManager + else + if [ "$MANAGER" == "wicd" ] && [ -f /usr/share/wicd/daemon/wicd-daemon.py ]; then + statusproc -p /var/run/wicd/wicd.pid "/usr/bin/python2 /usr/share/wicd/daemon/wicd-daemon.py" + fi fi ;; + restart) + ${0} stop + sleep 3 + ${0} start + ;; *) - echo "Usage: $0 {start|stop}" + echo "Usage: $0 {start|stop|restart|status}" exit 1 ;; esac |