:
#	@(#) fdswap.sh 23.1 91/08/29 
#
#	Copyright (C) 1987-1991 The Santa Cruz Operation, Inc.
#		All Rights Reserved.
#	The information in this file is provided for the exclusive use of
#	the licensees of The Santa Cruz Operation, Inc.  Such users have the
#	right to use, modify, and incorporate this code into other products
#	for purposes authorized by the license agreement provided they include
#	this notice and the associated copyright notice with any such product.
#	The information in this file is provided "AS IS" without warranty.
#
# 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
