home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World Interactive 1996 May
/
PCW_MAY_1996_LINUX_UKUUG.ISO
/
etc
/
syssetup
< prev
next >
Wrap
Text File
|
1993-01-10
|
3KB
|
124 lines
#
# Script to set up and customise users system.
function setupmodem()
{
echo "do you have a modem (y/n)?"
read ans;
if [ "$ans" = "Y" -o "$ans" = "y" ]; then
while [ "$MODEM" = "" ]; do
echo "1 - Com1 (/dev/ttyS0)"
echo "2 - Com2 (/dev/ttyS1)"
echo "3 - Com3 (/dev/ttyS2)"
echo "4 - Com4 (/dev/ttyS3)"
echo ""
echo "Your modem is on which com port (1/2/3/4)"
read ans;
case $ans in
1) MODEM=ttyS0 ;;
2) MODEM=ttyS1 ;;
3) MODEM=ttyS2 ;;
4) MODEM=ttyS3 ;;
*) echo "invalid com port" ;;
esac
done
(cd dev; ln -sf $MODEM modem)
# if [ ! -f etc/default/uugetty.modem ]; then
# cp -a etc/default/uugetty.ttyS1 etc/default/uugetty.modem
# echo "ALTLOCK=$MODEM" >> etc/default/uugetty.modem;
# fi
fi
}
function setupmouse()
{
echo "do you have a mouse (y/n)?"
read ans;
if [ "$ans" = "Y" -o "$ans" = "y" ]; then
while [ "$MOUSE" = "" ]; do
echo "1 - Logitech BusMouse"
echo "2 - PS2 Bus Mouse"
echo "3 - Microsoft Bus Mouse"
echo "4 - ATI XL Bus Mouse"
echo "5 - Microsoft Serial Mouse"
echo "6 - Logitech Serial Mouse"
echo "7 - MouseSystems Serial Mouse"
echo "8 - MM Serial Mouse"
echo ""
echo "What type of mouse do you have (1-8)"
read ans;
case $ans in
1) MOUSE=bmouselogitec ;;
2) MOUSE=ps2aux ;;
3) MOUSE=bmousems ;;
4) MOUSE=bmouseatixl ;;
5|6|7|8) MOUSE=serial ;;
*) echo "invalid mouse type" ;;
esac
done
while [ "$MOUSE" = "serial" ]; do
echo "1 - Com1 (/dev/ttyS0)"
echo "2 - Com2 (/dev/ttyS1)"
echo "3 - Com3 (/dev/ttyS2)"
echo "4 - Com4 (/dev/ttyS3)"
echo ""
echo "Your mouse is on which com port (1/2/3/4)"
read ans;
case $ans in
1) MOUSE=ttyS0 ;;
2) MOUSE=ttyS1 ;;
3) MOUSE=ttyS2 ;;
4) MOUSE=ttyS3 ;;
esac
done
if [ "$MOUSE" = "$MODEM" ]; then
echo "warning: mouse device $MOUSE is on the same device as the modem";
else
(cd dev; ln -sf $MOUSE mouse )
return 0;
fi
fi
}
setuphostname()
{
if [ ! -d etc/inetd ]; then
return 0;
fi
while [ 0 ]; do
echo -n "Enter the hostname, ie the name you wish to call this machine: "
read ans;
if [ "$ans" != "" ]; then
echo $ans > etc/inetd/host
echo "Hostname set. Remember to edit /etc/inet/hosts for ip stuff".
break;
fi
done
while [ 0 ]; do
echo -n "Enter the domain name (eg. softlanding.com): "
read ans;
if [ "$ans" != "" ]; then
echo $ans > etc/inetd/domain
echo "Domainname set. running /etc/inet/hostcvt.build to configure DNS".
( cd etc/inet; hostcvt.build );
return 0;
fi
done
}
ROOTDEV=/
if [ "$1" = "-instroot" ]; then
ROOTDEV=$2;
shift 2;
fi
cd $ROOTDEV
echo "/etc/syssetup: Configuring system to local defaults"
setupmodem;
setupmouse;
#setuphostname;
if [ "$1" = '-install' ]; then
etc/sysperms -instroot $ROOTDEV -install
fi