:
###############################################################################
#                                                                             #
#  mountcmd.sh		sample script for MOUNTCMD                            #
#                                                                             #
#     If the MOUNTCMD variable is set, this command will be called BEFORE     #
#     BRU attempts to read or write a tape.                                   #
#                                                                             #
#     Please modify this script to suit your own needs.                       #
#                                                                             # 
#                                                                             #
###############################################################################

CMD=$0		# name of this command

DEV=$1		# 1st parameter is device name
VOL=$2		# 2nd parameter is expected volume number 
MODE=$3		# 3rd parameter is BRU mode letter
MSIZE=$4	# 4th parameter is media size in Kbytes


case "$MODE" in
     c ) :
	#----------------------------------------------------------
	# Replace the following lines with any commands that      |
	# should be called before BRU attempts to WRITE to a tape |
	#----------------------------------------------------------

	echo "$CMD: volume $VOL on device $DEV (mode = $MODE)"

	#----------------------------------------------------------
	# Sample command to create a file containing label info    |
	#----------------------------------------------------------
	echo "VOLUME $VOL LABEL" > /tmp/labelfile

	RTN=$?		# set return code
	;;
    [idtgx] ) :
	#----------------------------------------------------------
	# Replace the following lines with any commands that      |
	# should be called before BRU attempts to READ a tape     |
	#----------------------------------------------------------

	echo "$CMD: volume $VOL on device $DEV (mode = $MODE)"	
	RTN=$?		# set return code
	;;
esac

exit $RTN	# return 0 if successful
