#!/bin/sh 
clear
echo
echo
echo
echo
echo "           1.  Serial mouse on /dev/ttyS0 (COM1)."
echo
echo "           2.  Serial mouse on /dev/ttyS1 (COM2)."
echo
echo "           3.  PS/2-type mouse on /dev/psaux (little round plug)."
echo
echo
echo -n "Select one of the above numbers: "
read 
echo
case $REPLY in
1|2|3)
  rm /dev/mouse 2>/dev/null
  cd /dev
  clear
  echo
;;
*)
  echo "Invalid response.  No change to mouse settings."
esac
case $REPLY in 
1)  
  ln -s ttyS0 mouse
  echo "Mouse on /dev/ttyS0  (COM1)."
;; 
2)  
  ln -s ttyS1 mouse
  echo "Mouse on /dev/ttyS1 (COM2)."
;;
3)  
  ln -s psaux mouse
  echo "Mouse on /dev/psaux (PS/2 type)."
  echo
  echo "This mouse requires the psaux module.  Now attempting to install it..."
  echo
  sleep 2
  insmod psaux 2>/dev/null
  lsmod | grep psaux >/dev/null
  if [ $? = 0 ] ; then
   echo "Success.  The module has been installed."  
   echo
   sleep 2
   echo "To make the installation of this module automatic (at system startup)," 
   echo "remove the # from the 'insmod psaux' line in /etc/rc.d/rc.S."
  else
   echo "Fail.  Your system has not accepted the module."  
   echo "Are you sure your mouse is a PS/2 mouse?"
   REPLY=0
  fi
esac
case $REPLY in
1|2|3)
 cd -
 echo
 echo This configuration is for a standard, Microsoft-compatible mouse.  If your
 echo mouse misbehaves with this setting, edit /etc/XF86Config and change the 
 echo Pointer Protocol from Microsoft to a more appropriate setting.  The possible 
 echo settings are:  BusMouse, GlidePoint, GlidePointPS/2, IntelliMouse, IMPS/2, 
 echo MMHitTab, MMSeries, Mouseman, MousemanPlusPS/2, MouseSystems, NetMousePS/2, 
 echo NetScrollPS/2, OSMouse, PS/2, SysMouse, ThinkingMouse, ThinkingMousePS/2 
 echo and Xqueue. 
esac
echo

   
