#ident	"@(#)initpkg:common/cmd/initpkg/init.d/adv	1.3.10.4"

if [ -z "$LC_ALL" -a -z "$LC_MESSAGES" ]
then
	if [ -z "$LANG" ]
	then
		LNG=`defadm locale LANG 2>/dev/null`
		if [ "$?" != 0 ]
		then LANG=C
		else eval $LNG
		fi
	fi
	export LANG
fi
LABEL="UX:$0"
CAT=uxrc

USAGE="/etc/init.d/adv {start | stop}"
if [ $# -lt 1 ]
then
	pfmt -l $LABEL -s action -g $CAT:4 "Usage: %s\n" "$USAGE"
	exit 	exit 1
fi
case $1 in
'start')

#	advertise everything in dfstab (replacement for /etc/rstab)
 
 	if [ -f /etc/dfs/dfstab ]
 	then
 		$TFADMIN /sbin/sh /etc/dfs/dfstab
 	fi
	;;

'stop')
#		the following unadvertises everything currently advertised

	if [ -f /etc/dfs/sharetab ]
	then
		/usr/bin/cat /etc/dfs/sharetab |
			while read path resource junk
			do 
				$TFADMIN /usr/sbin/unshare ${resource}
			done
	fi
	;;
*)
	pfmt -l $LABEL -s action -g $CAT:4 "Usage: %s\n" "$USAGE"
	exit 1
	;;
esac
