#
# Functions for hotplugable net device
#					Shuu Yamaguchi <shuu@dotAster.com>
# $Id: net_functions,v 1.1 2003/09/25 00:03:59 shuu Exp shuu $

# check network device
# waiting for 6 sec until the device is found.
wait_dev() {
	for sec in 1 2 3
	do
		grep $INTERFACE /proc/net/dev > /dev/null
		if [ $? -eq 0 ];then
			break;
		fi
		sleep $sec
	done
}

# INTERFACE: network interface name
get_interface()
{
	if [ "$INTERFACE" = "" ];then
		if [ "$DEVPATH" = "" ];then
			logger -i -t "net" -p daemon.err "Network Interface is not found"
			exit 1;
		else
			INTERFACE=`basename $DEVPATH`
		fi
	fi
}
