Re: Multiple PPP Configurations
>>>>> On Wed, 1 Oct 1997 15:22:21 -0500 (CDT), "Walter L. Preuninger II" <walterp@rapidramp.com> said:
Walter> Is there a way to have more than one pppd configuration? Getting another
Walter> modem is not an option.
Walter> What I would like is something along these lines:
Walter> pon work
Walter> poff
Walter> pon internet
Hello,
another solution that works here fine is the following one: I copied the
pon-script under a slightly different name to a bin directory and changed
the name of the dialer script in the pppd line.
It generates a complete chat script for each number and doesn't handle
the dial strings to chat on the command line. Probably there are some
trap commands missing.
Hth -- Peter
#!/bin/sh
#
# arbi-dialer:
# Special script for linux called by pppd to connect to the local ISP
# at the university. So the options for pppd are something like
# pppd ... connect arbi-dialer
#
# There are 5 possible numbers to dial (stored in the string vector
# ChatDialStrings). We dial one after the other until we get a successfull
# connection. This process is retried $Retries times (default is 3 times).
# The chat script passed to the chat command is generated temporary for
# each phone number by this script.
# The script might be public readable, it contains no password/ login
# information, which is stored in the pap-secrets file.
#
# Written by Peter.Weiss@Informatik.Uni-Oldenburg.DE, 9/ 97
ChatScript=/tmp/ppp.chatscript.$$
Chat=/usr/sbin/chat
Retries=3
# Basic chat initialization strings
ChatInitStrings="ABORT BUSY
ABORT \"NO CARRIER\"
ABORT VOICE
ABORT \"NO DIALTONE\"
\"\" ATZ
\"OK-+++\c-OK\" ATH0
\"OK\" ATM0"
ChatDialStrings=([0]="\"OK\" ATDT7983110"
[1]="\"OK\" ATDT7983125"
[2]="\"OK\" ATDT7982382"
[3]="\"OK\" ATDT7982157"
[4]="\"OK\" ATDT7982158")
# there are no login/ password phrases cause the rest is done using PAP and
# is done by pppd itself
ChatConnectString="CONNECT \"\""
i=0
while [ $i -lt $Retries ]; do
j=0
while [ $j -lt 5 ]; do
cat > $ChatScript <<EOF
$ChatInitStrings
${ChatDialStrings[$j]}
$ChatConnectString
EOF
$Chat -v -f $ChatScript
result=$?
# Connection established??
if [ $result -eq 0 ]; then
break;
fi
j=`expr $j + 1`
done
if [ $result -eq 0 ]; then
break;
fi
i=`expr $i + 1`
done
# clean up temporary file
rm $ChatScript
exit $result
--
------------------------------------------------------------------------------
Peter Weiss, Sonnenstraße 17, D-26123 Oldenburg, Tel: 0441/ 81058
http://www.informatik.uni-oldenburg.de:/~weissp
------------------------------------------------------------------------------
-- Slow has got 4 letters so has calm; speed has got 5 letters so has death --
------------------------------------------------------------------------------
--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org .
Trouble? e-mail to templin@bucknell.edu .
Reply to: