home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World Interactive 1996 May / PCW_MAY_1996_LINUX_UKUUG.ISO / etc / syssetup < prev    next >
Text File  |  1993-01-10  |  3KB  |  124 lines

  1. #
  2. # Script to set up and customise users system.
  3.  
  4. function setupmodem()
  5. {
  6.     echo "do you have a modem (y/n)?"
  7.     read ans;
  8.     if [ "$ans" = "Y" -o "$ans" = "y" ]; then
  9.         while [ "$MODEM" = "" ]; do
  10.             echo "1 - Com1 (/dev/ttyS0)" 
  11.             echo "2 - Com2 (/dev/ttyS1)" 
  12.             echo "3 - Com3 (/dev/ttyS2)" 
  13.             echo "4 - Com4 (/dev/ttyS3)" 
  14.             echo ""
  15.             echo "Your modem is on which com port (1/2/3/4)"
  16.             read ans;
  17.             case $ans in
  18.             1) MODEM=ttyS0 ;;
  19.             2) MODEM=ttyS1 ;;
  20.             3) MODEM=ttyS2 ;;
  21.             4) MODEM=ttyS3 ;;
  22.             *) echo "invalid com port" ;;
  23.             esac
  24.         done
  25.         (cd dev; ln -sf $MODEM modem)
  26. #        if [ ! -f etc/default/uugetty.modem ]; then
  27. #            cp -a etc/default/uugetty.ttyS1 etc/default/uugetty.modem
  28. #            echo "ALTLOCK=$MODEM" >> etc/default/uugetty.modem;
  29. #        fi
  30.     fi
  31. }
  32.  
  33. function setupmouse()
  34. {
  35.     echo "do you have a mouse (y/n)?"
  36.     read ans;
  37.     if [ "$ans" = "Y" -o "$ans" = "y" ]; then
  38.         while [ "$MOUSE" = "" ]; do
  39.             echo "1 - Logitech BusMouse"
  40.             echo "2 - PS2 Bus Mouse"
  41.             echo "3 - Microsoft Bus Mouse"
  42.             echo "4 - ATI XL Bus Mouse"
  43.             echo "5 - Microsoft Serial Mouse"
  44.             echo "6 - Logitech Serial Mouse"
  45.             echo "7 - MouseSystems Serial Mouse"
  46.             echo "8 - MM Serial Mouse"
  47.             echo ""
  48.             echo "What type of mouse do you have (1-8)"
  49.             read ans;
  50.             case $ans in
  51.             1) MOUSE=bmouselogitec ;;
  52.             2) MOUSE=ps2aux ;;
  53.             3) MOUSE=bmousems ;;
  54.             4) MOUSE=bmouseatixl ;;
  55.             5|6|7|8) MOUSE=serial ;;
  56.             *) echo "invalid mouse type" ;;
  57.             esac
  58.         done
  59.         while [ "$MOUSE" = "serial" ]; do
  60.             echo "1 - Com1 (/dev/ttyS0)" 
  61.             echo "2 - Com2 (/dev/ttyS1)" 
  62.             echo "3 - Com3 (/dev/ttyS2)" 
  63.             echo "4 - Com4 (/dev/ttyS3)" 
  64.             echo ""
  65.             echo "Your mouse is on which com port (1/2/3/4)"
  66.             read ans;
  67.             case $ans in
  68.             1) MOUSE=ttyS0 ;;
  69.             2) MOUSE=ttyS1 ;;
  70.             3) MOUSE=ttyS2 ;;
  71.             4) MOUSE=ttyS3 ;;
  72.             esac
  73.         done
  74.         if [ "$MOUSE" = "$MODEM" ]; then
  75.             echo "warning: mouse device $MOUSE is on the same device as the modem";
  76.         else
  77.             (cd dev; ln -sf $MOUSE mouse )
  78.             return 0;
  79.         fi
  80.     fi
  81. }
  82.  
  83. setuphostname()
  84. {
  85.     if [ ! -d etc/inetd ]; then
  86.         return 0;
  87.     fi
  88.     while [ 0 ]; do
  89.         echo -n "Enter the hostname, ie the name you wish to call this machine: "
  90.         read ans;
  91.         if [ "$ans" != "" ]; then
  92.             echo $ans > etc/inetd/host
  93.             echo "Hostname set.  Remember to edit /etc/inet/hosts for ip stuff".
  94.             break;
  95.         fi
  96.     done
  97.     while [ 0 ]; do
  98.         echo -n "Enter the domain name (eg. softlanding.com): "
  99.         read ans;
  100.         if [ "$ans" != "" ]; then
  101.             echo $ans > etc/inetd/domain
  102.             echo "Domainname set.  running /etc/inet/hostcvt.build to configure DNS".
  103.             ( cd etc/inet; hostcvt.build );
  104.             return 0;
  105.         fi
  106.     done
  107. }
  108.  
  109. ROOTDEV=/
  110. if [ "$1" = "-instroot" ]; then
  111.     ROOTDEV=$2;
  112.     shift 2;
  113. fi
  114.  
  115. cd $ROOTDEV
  116.  
  117. echo "/etc/syssetup: Configuring system to local defaults"
  118. setupmodem;
  119. setupmouse;
  120. #setuphostname;
  121. if [ "$1" = '-install' ]; then
  122.     etc/sysperms -instroot $ROOTDEV -install
  123. fi
  124.