]> pd.if.org Git - startuptools/blobdiff - scripts/network
added startup scripts
[startuptools] / scripts / network
diff --git a/scripts/network b/scripts/network
new file mode 100755 (executable)
index 0000000..4e7040b
--- /dev/null
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+. /etc/rc.conf
+
+case "$1" in 
+       start)
+               for n in $NETWORKS ; do
+                       /sbin/ifup $n
+               done
+               ;;
+       stop)
+               # NETWORKS might have changed
+               # TODO record the network somewhere under /var/run/startuptools
+               for n in $NETWORKS ; do
+                       /sbin/ifdown $n
+               done
+               ;;
+       restart)
+               $0 stop
+               sleep 1
+               $0 start
+               ;;
+       status)
+               exit 0
+               ;;
+       *)
+               echo "usage: $0 {start | stop | restart | status }"
+               exit 1
+esac