[BACK]Return to downinterfaces CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / etc / rc.d

File: [cvs.NetBSD.org] / src / etc / rc.d / downinterfaces (download)

Revision 1.1, Tue Sep 4 18:09:14 2001 UTC (17 years, 9 months ago) by martin
Branch: MAIN

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.

#!/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