#!/bin/sh
#
# varyoff:       Dynamically dettaches a SCSI device
#
# See how we were called.
case "$1" in
  tape)
	echo -n "Dettaching SCSI tape id=4: "
	echo "scsi remove-single-device 0 0 4 0" > /proc/scsi/scsi
	echo
	;;
  cdw)
	echo -n "Dettaching SCSI CDROM Writer id=5: "
	echo "scsi remove-single-device 0 0 6 0" > /proc/scsi/scsi
	echo
	;;
  *)
	echo "*** Usage: varyoff {tape|cdw}"
	exit 1
esac

exit 0

