#!/bin/sh
if [ $# -eq 0 ] ; then
	DRIVE=/dev/fd0
else
	DRIVE=$1
fi
SCRIPT=`basename $0`
LOWERCASE=0
if [ $SCRIPT = "INSTALL" ] ; then
	MYDIR=`dirname $0`
elif [ $SCRIPT = "install" ] ; then
	MYDIR=`dirname $0`
	LOWERCASE=1
else
	# In case we were run using ". INSTALL" or "sh < INSTALL",
	# try to find CD-ROM drive.  We assume also that file
	# names are in upper case.
	grep iso9660 /etc/fstab
	if [ $? ] ; then
		# We found an ISO 9660 device in /etc/fstab.
		# Use $2 as the mount point.
		set `grep iso9660 /etc/fstab`
		if [ $# -gt 2 ] ; then
			MYDIR=$2/LINUX
		fi
	else
		# No ISO 9660 device in /etc/fstab.  Default
		# to /mnt/cdrom as the mount point.
		MYDIR="/mnt/cdrom/LINUX"
	fi
fi
clear
if [ $LOWERCASE -eq 1 ] ; then
	more $MYDIR/license
else
	more $MYDIR/LICENSE
fi
echo -e "\a"
echo "                 PowerQuest ServerMagic 3.0"
echo "Copyright (c) 1994-1999 PowerQuest Corporation.  All rights reserved."
echo
echo "Two 1.44 MB diskettes are needed to create the diskette set."
echo "Your diskette drive must be" $DRIVE "."
echo "All data previously on your diskettes will be destroyed."
echo -e "\a"
echo "Insert diskette one into your floppy drive and press Enter"
echo -n "(Control-C to abort) ..."
read
if [ $LOWERCASE -eq 1 ] ; then
	dd bs=1024 if=$MYDIR/smfloppy.img of=$DRIVE
else
	dd bs=1024 if=$MYDIR/SMFLOPPY.IMG of=$DRIVE
fi
echo -n -e "\a"
echo "Insert diskette 2 into your floppy drive and press Enter"
echo -n "(Control-C to abort) ..."
read
if [ $LOWERCASE -eq 1 ] ; then
	dd bs=1024 if=$MYDIR/dtfloppy.img of=$DRIVE
else
	dd bs=1024 if=$MYDIR/DTFLOPPY.IMG of=$DRIVE
fi
echo 
echo "Your diskette set is complete.  To run ServerMagic 3.0 you"
echo "need to insert disk one and reboot your computer.  After ServerMagic"
echo "is running, insert diskette 2.  Diskette 2 contains the help file and"
echo "the partinfo program.  For more information on using ServerMagic"
echo "please refer to the ServerMagic User's Guide."
echo
