#!/bin/sh
# set -x
#
# volmgt_disable - Disable Volume Manager support for the floppy device.
# This will allow SunPC to access the floppy device without having to
# go through the Volume Manager. We comment out the floppy etnry in the
# vold.conf file to disable floppy support.
#

# Volume Manager Configuration file
VOLD="/etc/vold.conf"

#       Check that user 'root' has invoked sunpc_install.
ISROOT=`/bin/id | /bin/awk '/root/ {print}'`
if [ -z "$ISROOT" ]
then
        echo "You must be a superuser to run the volmgt_disable script."
        exit 1
fi

#
# Disable Volume Floppy Management for Solaris 5.2 and up.
#
if [ -f ${VOLD} ]
then
    cp -p ${VOLD} ${VOLD}.beforesunpc

    sed   '/^use floppy drive/ i\
# The next line is commented out to disable Floppy Volume Management for SunPC'  ${VOLD} > ${VOLD}.temp1
     sed '/^use floppy drive/ s/^/#/' ${VOLD}.temp1 > ${VOLD}.temp2

    /usr/bin/rm ${VOLD}
    /usr/bin/rm ${VOLD}.temp1
    /usr/bin/mv ${VOLD}.temp2 ${VOLD}

fi

/usr/bin/echo "This script has modified the Volume Manager configuration files"
/usr/bin/echo "to disable Volume Manager support for the system floppy drives."
/usr/bin/echo "You must reboot your system for these changes to take effect."
