#!/bin/sh
# Copyright (C) 2002 Ensim Corporation. All Rights Reserved.
#

echo "Please insert a blank diskette in the floppy drive."
echo -n "Press <ENTER> when you are ready ... "
read _q_yorn
 	 
F_check_fs loop /proc/devices
	if [ $? -ne 0 ] # loop filesystem not supported
 		then
    		echo "*** Loopback filesystem not supported. Exiting ..."
    		exit 1
	fi

mount -o loop "$_q_bootimage" /mnt/floppy
		

cp -rf $KSGENDIR/ks.cfg /mnt/floppy
cp -rf $KSGENDIR/syslinux.cfg /mnt/floppy
umount -f /mnt/floppy

echo ""
echo "RedHat Installation floppy being created "
echo "This will take a few minutes..."
echo ""

dd if="$_q_bootimage" of=/dev/fd0 1>>/dev/null 2>>/dev/null
	if [ $? -ne 0 ]
       		then
       		echo "*** Error while dumping floppy image. Exiting."
            	exit 1
        fi
echo ""
echo "RedHat installation floppy created successfully."
echo "Insert the floppy generated , in the floppy drive of the server for WEBppliance."
echo "Restart the target server after inserting the floppy for installation of Webppliance for Linux. "
echo ""
