# @(#) install.sis 1.0 07/10/95
#
# Copyright (C) SIS Technology, Inc. 1995
#
#
PATH=/bin:/usr/bin:/etc
TMP=/tmp
CONFDIR=/etc/conf/cf.d
UINSTD=/usr/lib/custom
SDEVICED=/etc/conf/sdevice.d
#
: ${OK=0} ${FAIL=1} ${TRUE=0} ${FALSE=1}
# Function definitions
cleanup()
{
rm -rf $tmp*
exit $1
}
# usage: safecopy file1 file2
# copies file1 to file2 without chance of interruption
safecopy()
{
trap "" 1 2 3 15
cp $1 $2
trap 1 2 3 15
}
# usage: setbootstring
# sets DEFBOOTSTR
setbootstring()
{
sed -e 's;hd(40)unix;hd(40)unix hd=sis;' < /etc/default/boot > /tmp/boot.$$
mv /tmp/boot.$$ /etc/default/boot
}
#
# MAIN()
#
trap 'cleanup $FAIL' 1 2 3 15
#setbootstring
cat $CONFDIR/mdevice $CONFDIR/Master > $TMP/mdevice.new
safecopy $TMP/mdevice.new $CONFDIR/mdevice
sed -e 's;Y;N;' < $SDEVICED/wd > $TMP/wd.new
safecopy $TMP/wd.new $SDEVICED/wd
sed -e 's;Y;N;' < $SDEVICED/wd0 > $TMP/wd0.new
safecopy $TMP/wd0.new $SDEVICED/wd0
sed -e 's;Y;N;' < $SDEVICED/wd1 > $TMP/wd1.new
safecopy $TMP/wd1.new $SDEVICED/wd1
rm -f $TMP/*.new
cd /
mkdev hd
exit $OK