: #	@(#)setlock	1.1	create lock file, exit w/success status
# setlock:  
#	Create a lock file.  Exit 0 if succeed, 1 if fail.  The lock
#	is created as a directory because not even root can mkdir over
#	an existing file.  Should NOT be invoked with the dot (.)
#	command or the exit statements will exit the invoking program.
# Author:  Larry Bamford, AO, SSD, COB, STS, ETC, 2/16/89


_LOCKNAME=$1	# lockfile to create
_ERRMSG="$2"	# failure message

#echo REMEMBER TO CHANGE PATH AND DIR OF $0 BEFORE INSTALLING
#PATH=.:/adm:/bin:/etc:/usr/bin	# for testing
PATH=/adm:/bin:/etc:/usr/bin	# for safety
export PATH
if persist mkdir $_LOCKNAME
then
	exit 0
else 
	echo "$_ERRMSG" 1>&2
	exit 1
fi
