* 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).
This commit is contained in:
parent
660b31de3a
commit
89432e7545
@ -1,31 +1,37 @@
|
|||||||
#!/bin/sh
|
#!/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
|
# PROVIDE: downinterfaces
|
||||||
# KEYWORD: shutdown
|
# KEYWORD: nostart shutdown
|
||||||
|
|
||||||
if [ "x$1" = "xstop" ]; then
|
$_rc_subr_loaded . /etc/rc.subr
|
||||||
|
|
||||||
. /etc/rc.conf
|
name="downinterfaces"
|
||||||
|
start_cmd=":"
|
||||||
|
stop_cmd="downinterfaces_stop"
|
||||||
|
|
||||||
tmp=$(ifconfig -lu)
|
downinterfaces_stop()
|
||||||
iflist=""
|
{
|
||||||
for int in $tmp; do
|
tmp=$(ifconfig -lu)
|
||||||
case $int in
|
iflist=""
|
||||||
pppoe*) iflist="$iflist $int"
|
for int in $tmp; do
|
||||||
;;
|
case $int in
|
||||||
esac
|
pppoe*) iflist="$iflist $int"
|
||||||
done
|
;;
|
||||||
iflist="$iflist $force_down_interfaces"
|
esac
|
||||||
if [ "$iflist" != "" ] && [ "$iflist" != " " ]
|
|
||||||
then
|
|
||||||
|
|
||||||
echo "Shutting down interfaces:$iflist"
|
|
||||||
for int in $iflist; do
|
|
||||||
ifconfig $int down
|
|
||||||
done
|
done
|
||||||
fi
|
iflist="$iflist $force_down_interfaces"
|
||||||
|
if [ "$iflist" != "" ] && [ "$iflist" != " " ]
|
||||||
|
then
|
||||||
|
|
||||||
fi
|
echo "Shutting down interfaces:$iflist"
|
||||||
|
for int in $iflist; do
|
||||||
|
ifconfig $int down
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
load_rc_config $name
|
||||||
|
run_rc_command "$1"
|
||||||
|
Loading…
Reference in New Issue
Block a user