#! /bin/sh
#
# nfs - start NFS in response to interface change
#
# Robert Love

RL=$(/sbin/runlevel); RL=${RL#* }
test -z "$RL" && RL=`sed -n 's=^id:\(.\):initdefault.*$=\1=p' /etc/inittab`

case "$2" in
	up)
		ls /etc/init.d/rc${RL}.d/S*nfs &>/dev/null || exit 2
		/etc/init.d/nfs restart
		;;
	down)
		# It is too late to stop NFS.  Better to do nothing, in
		# case we come back up
		exit 0
		;;
	*)
		exit 0
		;;
esac
