Bug#1272: More powerfull ppp-connect
Package: ppp
Version: 2.1.2b
Hi,
this is not really a bug, I'm reporting, but it maybe a useful suggestion.
(1) in "/etc/ppp/options" one should include "asyncmap 0" so the
connection is run at full speed
Maybe this causes problems for some people, I don't know.
(2) I wrote a script that allows multiple phone-numbers and multiple tries
for establishing the connection, based on "chat".
The copy on my www-server is commented in German so I post a
english version here ....
8<-----8<-----8<-----8<-----8<-----8<-----8<-----
#!/bin/sh
# DT= tone dialing DP= pulse dialing M0= be quiet
INIT_STRING=M1DT
# alternate init-string (used by "minicom", works in most cases)
#INIT_STRING="S7=45S0=0L1V1X4&c1E1Q0DP"
# first telephone number (do not use spaces or other chars than numbers!)
TEL_NR_1=02219428111
# second telephone-number (do not use spaces or other chars than numbers!)
TEL_NR_2=02214200901
# Maximium number of tries
MAX_TRIES=2
# your login-id
USER=MY_LOGIN_ID
# your password
PASSWORD=ITS_TOP_SECRET
# be aware: everyone can see the your password while connecting via "ps"
# you can prevent this by putting the script in a seperate file (ommit the
# trailing backslashes !) and call "chat -f THE_SEPERATE_FILE"
function dial() {
chat \
ABORT "NO CARRIER" ABORT "NO DIALTONE" ABORT BUSY ABORT ERROR\
"" ATZ\
OK AT$INIT_STRING$1 TIMEOUT 120\
CONNECT "" TIMEOUT 20\
sername: $USER TIMEOUT 10\
ssword: $PASSWORD\
"port" ppp
}
TRIES=0
while [ $TRIES -lt $MAX_TRIES ]
do
TRIES="$[$TRIES+1]"
if dial $TEL_NR_1
then
echo -ne "^G" 1>&2
exit 0
fi
sleep 5
if dial $TEL_NR_2
then
echo -ne "^G" 1>&2
exit 0
else
sleep 60
fi
done
echo -e "\n\nppp-connect: no connection after $MAX_TRIES tries - giving up"
1>&
echo -e "(you may increase the number of tries in /etc/ppp/ppp-connect )"
1>&2
exit 1
8<-----8<-----8<-----8<-----8<-----8<-----8<-----
Reply to: