:
#	@(#) fdswap.sh 1.2 89/05/30 
#
#	Copyright (C) The Santa Cruz Operation, 1987, 1988, 1989.
#	This Module contains Proprietary Information of
#	The Santa Cruz Operation and should be treated as Confidential.
#
#
# FDSWAP - swap floppy drives
#
PATH=/bin:/usr/bin:/etc

CMOSADDR=0x2c

usage() {
	echo "Usage: fdswap [on|off]" >&2
	exit 1
}

case $# in
0)
	set -- `cmos $CMOSADDR`
	case $2 in
	0)
		VALUE=off
		;;
	1)
		VALUE=on
		;;
	*)
		VALUE=unknown
		;;
	esac
	echo "Floppy drive swap is $VALUE"
	;;
1)
	case $1 in
	on)
		VALUE=1
		;;
	off)
		VALUE=0
		;;
	*)
		usage
		;;
	esac
	cmos $CMOSADDR $VALUE > /dev/null
	;;
*)
	usage
	;;
esac

