summaryrefslogtreecommitdiffstats
path: root/aaabasicfs/network
diff options
context:
space:
mode:
authortnut <tnut at nutyx dot com>2012-01-08 12:12:28 +0100
committertnut <tnut at nutyx dot com>2012-01-08 12:12:28 +0100
commit9291e062cb24bac5d7c7059d4dc64669c1917b33 (patch)
treeae6f7e4fb2769d6c53b214c5e0b4d862f1df98dc /aaabasicfs/network
parentc9972ec7f32bf9d37388e853fe9bf633e242d05a (diff)
downloadnutyx-pakxe-9291e062cb24bac5d7c7059d4dc64669c1917b33.tar.gz
nutyx-pakxe-9291e062cb24bac5d7c7059d4dc64669c1917b33.tar.bz2
nutyx-pakxe-9291e062cb24bac5d7c7059d4dc64669c1917b33.tar.xz
nutyx-pakxe-9291e062cb24bac5d7c7059d4dc64669c1917b33.zip
aaabasicfs 2011-3 et split des dépot base et extra en 2 git séparé
Diffstat (limited to 'aaabasicfs/network')
-rwxr-xr-xaaabasicfs/network96
1 files changed, 96 insertions, 0 deletions
diff --git a/aaabasicfs/network b/aaabasicfs/network
new file mode 100755
index 000000000..8340cd68e
--- /dev/null
+++ b/aaabasicfs/network
@@ -0,0 +1,96 @@
+#!/bin/sh
+# Begin $rc_base/init.d/network
+
+# Based on sysklogd script from LFS-3.1 and earlier.
+# Rewritten by thierryn1@hispeed.ch
+
+. /etc/sysconfig/rc
+. $rc_functions
+
+# Network configuration
+. /etc/sysconfig/network
+
+NM_PIDFILE=/var/run/NetworkManager.pid
+WICD_PIDFILE=
+
+TIME=$NETWORKDELAY
+case "$1" in
+ start)
+ 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
+ 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..."
+ echo_ok
+ fi
+
+ else
+ if [ -f /etc/rc.d/init.d/iplink ]; then
+ /etc/rc.d/init.d/iplink start
+ fi
+ fi
+ ;;
+
+ stop)
+ 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
+ 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|restart|status}"
+ exit 1
+ ;;
+esac
+
+# End $rc_base/init.d/network