#!/bin/ksh
#----------------------------------------------------
#
#  SGI "Bogus" Mouse Driver Installation script
#
#  Current Revision:
#   $Workfile:   instaldg  $
#   $Revision:   5.0  $
#   $Date:   02 Feb 1994 11:02:32  $
#
# Portions provided by SGI, modified by BSI.
#
#----------------------------------------------------
# Must be root user to run this shell script!!
[ `id|cut -d ' ' -f1|grep "root"` ] || echo "Must be root to execute this shell script" && exit

#-------------------------------------------------------------
# Copy the files from subdirectories into the system directory
#-------------------------------------------------------------
cp 	./boot/* 	/var/sysgen/boot
cp 	./master.d/* 	/var/sysgen/master.d

#-------------------------------------------------------------
# Copy the config file to the X directory
# Create the directory if it not there already.
#-------------------------------------------------------------
[ -d /usr/lib/X11/input/config ] || mkdir /usr/lib/X11/input/config
cp 	./config/*	/usr/lib/X11/input/config

#-------------------------------------------------------------
# Make the device nodes needed by the SGI Bogus Mouse
#-------------------------------------------------------------
mknod 	  /dev/input/bmouse c 62 1
chmod +wr /dev/input/bmouse

mknod 	  /dev/bmdev c 62 0
chmod +wr /dev/bmdev

#-------------------------------------------------------------
# The mstndig.exe program must be set up to run with root 
# privileges, or it won't work.
#-------------------------------------------------------------
chown root    ../mstndig.exe
chmod u+srwx  ../mstndig.exe

#-------------------------------------------------------------
# Now remind the user to edit file, autogconfig, and reboot
#-------------------------------------------------------------
echo "Please consult the documentation for the following steps:"
echo "Editting /var/sysgen/system/gfx.sm"
echo "Executing  the 'autoconfig -f' command"
echo "Rebooting"

