#!/sbin/runscript
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-apps/ifplugd/files/ifplugd,v 1.2 2003/03/21 15:58:05 wmertens Exp $

#NB: Config is in /etc/conf.d/ifplugd

IFPLUGD=/usr/sbin/ifplugd

[ -z "$INTERFACES" ] && INTERFACES="eth0"
[ "$INTERFACES" = "auto" ] && INTERFACES=`cat /proc/net/dev | awk '{ print $1 }' | grep ^eth | cut -d: -f1`

start() {
	einfon "Starting ifplugd: "
	for IF in $INTERFACES ; do
		echo -n "$IF "
		$IFPLUGD -i $IF $ARGS
	# You can't trust the exit code, so we pretend it works
	#	status=$?
	#	if [ $status -ne 0 ]; then
	#		echo
	#		eend $status "Problem starting for $IF"
	#		return 1
	#	fi
	done
	echo
	eend 0
}

stop() {
	einfon "Stopping ifplugd: "
	for IF in $INTERFACES ; do
		echo -n "$IF "
		$IFPLUGD -k -i $IF
	done
	echo
	eend 0
}


# vim:ts=4
