#! /bin/sh

# routine to show that something is happening when waiting for the
# automounter to finnish intialization.

ECHO=/usr/5bin/echo

autowaitsign () {
	case "$autowsign" in
	"" | "|" )
		autowsign="/";;
	"/")
		autowsign="-";;
	"-")
		autowsign="\\\\";;
	"\\\\")
		autowsign="|";;
	esac
	$ECHO "$autowsign\b\c"
}

# convenience routine to be used by the automount.conf file
autodefine () {
	eval $1=\"$2\"
	export $1
# Comment out the following line if you don't want the
# little spinning sign.
	autowaitsign
}

echo -n ' auto'
autodefine DURATION 300

autodefine ARCH `arch`
autodefine KARCH `arch -k`
autodefine SERVER $server
if [ "$SERVER" = "" ]; then
	autodefine SERVER `hostname`
fi

if [ -f /etc/automount.conf ]; then

	. /etc/automount.conf

	if [ -f /usr/etc/automount ]; then
		/bin/rm -rf /tmp_mnt/auto*
		if [ -f /etc/auto.master.server ]; then
			automount -m -tl $DURATION -f /etc/auto.master.server &
		else
			automount -tl $DURATION &
		fi
		echo -n 'mount'
	else
		echo -n 'mount(failed)'
	fi
else
	echo -n 'mount(failed)'
fi



