Hey all,
Myself and William Murphy have just spent a little while doin' a bit of
a script similar to what johnmc was on about a few days ago. It's 100%
UNfinished and we're not even sure if it works properly. Also, I'm sure
many of you shell programming experts will have much to say...
More later...
Ross.
Here's what we have so far:
---------------------------
#!/bin/sh
echo ""
echo "1. IOL"
echo "2. eircom"
echo "3. Esat NoLimits"
echo ""
echo "Please chose one of the above: "
read ISP_CHOICE
if test $ISP_CHOICE != 3
then echo "Please enter your username: "
read USERNAME
echo "Please enter your password: "
stty -echo
read PASSWORD
stty echo
elif test $ISP_CHOICE = 3
then USERNAME=nolimits
PASSWORD=nolimits
fi
case $ISP_CHOICE in
1) echo "Setting up IOL Connection..."
LOGIN="ogin: $USERNAME
ssword: $PASSWORD
rotocol: ppp"
NS1=194.125.2.241
NS2=194.125.2.242
PASSFILE=/etc/ppp/chatscript
AUTH_TYPE=0
NUMBER=1891121121;;
2)
echo "Setting up eircom Connection..."
LOGIN="ternet $USERNAME
'' $PASSWORD"
NS1=159.134.237.6
NS2=159.134.248.17
PASSFILE=/etc/ppp/chatscript
AUTH_TYPE=0
NUMBER=1891121121;;
3) LOGIN=''
NS1=194.145.128.1
NS2=194.145.128.2
AUTH_TYPE=pap
PASSFILE=/etc/ppp/AUTH_TYPE-secrets
NUMBER=13332103001235;;
esac
echo " Linux Windows"
echo " -------------------------"
echo "1) ttyS0 com1"
echo "2) ttyS1 com2"
echo "3) ttyS2 com3"
echo "4) ttyS3 com4"
echo "Please choose the appropriate option: "
read MODEM
MODEM=`expr $MODEM - 1`
echo "nameserver $NS1
namserver $NS2" >> /etc/resolv.conf
echo "TIMEOUT 45
ABORT BUSY
ABORT ERROR
ABORT 'NO CARRIER'
ABORT 'NO DIAL TONE'
ABORT 'NO DIALTONE'
'' ATZ
OK ATDT$NUMBER
CONNECT ''
$LOGIN" > /etc/ppp/chatscript
echo "modem
crtscts
defaultroute
\`chat -v -f /etc/ppp/chatscript\`
/dev/ttyS$MODEM" > /etc/ppp/options
if test $AUTH_TYPE != 0
then echo "user $USERNAME" >> /etc/ppp/options
echo "$USERNAME * $PASSWORD *" > /etc/ppp/$AUTH_TYPE-secrets
fi
chmod 700 $PASSFILE
--
Ross Lynch
087 6548827
ross at excentric.comkernel at student.nuigalway.ie
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!