Add support to down some interfaces before shutting down the system. All

pppoe*  interfaces are automatically shut down by this script, others may be
added to the force_down_interfaces variable in /etc/rc.conf.
This commit is contained in:
martin 2001-09-04 18:09:13 +00:00
parent e569277f0d
commit d7e4ab316c
2 changed files with 33 additions and 1 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: rc.conf,v 1.19 2001/07/05 05:26:57 tron Exp $
# $NetBSD: rc.conf,v 1.20 2001/09/04 18:09:13 martin Exp $
#
# /etc/defaults/rc.conf --
# default configuration of /etc/rc.conf
@ -111,6 +111,12 @@ ip6mode=host # host, autohost or router
ip6sitelocal=NO # IPv6 sitelocal addrs
rtsol=NO rtsol_flags="" # for ip6mode=autohost only
# Special treatment for interfaces that need to be downed on
# shutdown (because they might cause unecessary costs or block resources
# on the peer). All pppoe* interfaces are automatically included in this
# list, add others here manually.
# force_down_interfaces=""
# ALTQ configuration/monitoring daemon
altqd=NO altqd_flags=""

26
etc/rc.d/downinterfaces Normal file
View File

@ -0,0 +1,26 @@
#!/bin/sh
#
# $NetBSD: downinterfaces,v 1.1 2001/09/04 18:09:14 martin Exp $
#
# KEYWORD: shutdown
if [ $1 != "stop" ]; then exit 0; fi
. /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 exit 0; fi
echo "Shutting down interfaces:$iflist"
for int in $iflist; do
ifconfig $int down
done