#ident	"@(#)cmd-inet:etc/init.d/inetinit	1.9.3.1"

#	inet startup

LOG=/tmp/inet.start

if [ ! -d /usr/bin ]
then			
	# have to have /usr mounted
	exit 1
fi

case $1 in
'start')


	DEVEMD=0
	/usr/sbin/ifconfig emd${DEVEMD} >/dev/null 2>/dev/null
		if [ $? -eq 0 ]
		then
			#already started
			exit 0
		fi

	echo "The following commands were run from /etc/init.d/inetinit" > $LOG
	echo "/usr/sbin/slink -c /etc/inet/strcf" >> $LOG
	      /usr/sbin/slink -c /etc/inet/strcf  >> $LOG 2>> $LOG
	if [ $? -ne 0 ]
	then
		/usr/sbin/slink -u -c /etc/inet/strcf >/dev/null 2>/dev/null
		echo "\nERROR STARTING NETWORK: Full error message in $LOG\n"
		exit 1
	fi
	rm -f $LOG

	# run startup script
	/bin/sh /etc/inet/rc.inet
	exit $?

	;;

'stop')
	DEVEMD=0
	/usr/sbin/ifconfig emd${DEVEMD} down >/dev/null 2>/dev/null
	/usr/sbin/ifconfig lo0 down >/dev/null 2>/dev/null
	/usr/sbin/slink -u -c /etc/inet/strcf > /dev/null 2>/dev/null
	exit 0
	;;

*)
	exit 1
esac
