Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/etc/rc.d/downinterfaces,v retrieving revision 1.2 retrieving revision 1.6 diff -u -p -r1.2 -r1.6 --- src/etc/rc.d/downinterfaces 2001/09/04 20:40:40 1.2 +++ src/etc/rc.d/downinterfaces 2009/09/05 16:26:07 1.6 @@ -1,26 +1,37 @@ #!/bin/sh # -# $NetBSD: downinterfaces,v 1.2 2001/09/04 20:40:40 martin Exp $ +# $NetBSD: downinterfaces,v 1.6 2009/09/05 16:26:07 apb Exp $ # -# KEYWORD: shutdown +# PROVIDE: downinterfaces +# KEYWORD: nostart shutdown -if [ "x$1" != "xstop" ]; then exit 0; fi +$_rc_subr_loaded . /etc/rc.subr -. /etc/rc.conf +name="downinterfaces" +start_cmd=":" +stop_cmd="downinterfaces_stop" -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 exit 0; fi - -echo "Shutting down interfaces:$iflist" -for int in $iflist; do - ifconfig $int down -done +downinterfaces_stop() +{ + 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 + done + fi +} + +load_rc_config $name +run_rc_command "$1"