Module Name: src
Committed By: apb
Date: Sat Sep 5 16:26:07 UTC 2009
Modified Files:
src/etc/rc.d: downinterfaces
Log Message:
* Use functions from rc.subr, and indent the code.
* Add "KEYWORD: nostart", so /etc/rc doesn't try to run this (it would
have been harmless anyway).
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/etc/rc.d/downinterfaces
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/etc/rc.d/downinterfaces
diff -u src/etc/rc.d/downinterfaces:1.5 src/etc/rc.d/downinterfaces:1.6
--- src/etc/rc.d/downinterfaces:1.5 Mon Oct 11 15:00:51 2004
+++ src/etc/rc.d/downinterfaces Sat Sep 5 16:26:07 2009
@@ -1,31 +1,37 @@
#!/bin/sh
#
-# $NetBSD: downinterfaces,v 1.5 2004/10/11 15:00:51 christos Exp $
+# $NetBSD: downinterfaces,v 1.6 2009/09/05 16:26:07 apb Exp $
#
# PROVIDE: downinterfaces
-# KEYWORD: shutdown
+# KEYWORD: nostart shutdown
-if [ "x$1" = "xstop" ]; then
+$_rc_subr_loaded . /etc/rc.subr
-. /etc/rc.conf
-
-tmp=$(ifconfig -lu)
-iflist=""
-for int in $tmp; do
- case $int in
- pppoe*) iflist="$iflist $int"
- ;;
- esac
-done
-iflist="$iflist $force_down_interfaces"
-if [ "$iflist" != "" ] && [ "$iflist" != " " ]
-then
-
- echo "Shutting down interfaces:$iflist"
- for int in $iflist; do
- ifconfig $int down
+name="downinterfaces"
+start_cmd=":"
+stop_cmd="downinterfaces_stop"
+
+downinterfaces_stop()
+{
+ tmp=$(ifconfig -lu)
+ iflist=""
+ for int in $tmp; do
+ case $int in
+ pppoe*) iflist="$iflist $int"
+ ;;
+ esac
done
-fi
+ iflist="$iflist $force_down_interfaces"
+ if [ "$iflist" != "" ] && [ "$iflist" != " " ]
+ then
+
+ echo "Shutting down interfaces:$iflist"
+ for int in $iflist; do
+ ifconfig $int down
+ done
+ fi
+}
-fi
+load_rc_config $name
+run_rc_command "$1"