Thought maybe someone would be interested in this.

I was using standard chat\pppd scripts to dial in to my ISP.  I have two
choices of phone numbers to use when dialing in.  The first is fast, but
will get busy signals\etc. a decent portion of the time.  The other always
works but is significantly slower.

To solve this problem, I made a script in /usr/bin called "start-ppp".
It's contents are:

#!/bin/bash
/etc/ppp/ppp-on &

I modified /etc/ppp/ppp-on to look like this:
...
TELEPHONE=555-1212      # Primary number
ALT_TELEPHONE=555-3434  # Secondary number
...
export TELEPHONE ALT_TELEPHONE etc.
...
DIALER_SCRIPT=/etc/ppp/ppp-on-dialer
ALT_DIALER_SCRIPT=/etc/ppp/ppp-on-dialer-2

export DIALER_SCRIPT ALT_DIALER_SCRIPT
...
# Initiate the connection
...
/etc/ppp/mypppd &

XYPID=`cat /tmp/my_pid`
wait $xypid

if(test ! -f /tmp/am_online)
then /usr/sbin/pppd [...more options...] connect $ALT_DIALER_SCRIPT
fi


/etc/ppp/mypppd looks like this:

#!/bin/bash
echo $$ > /tmp/my_pid

export ALT_TELEPHONE TELEPHONE ACCOUNT PASSWORD

/usr/sbin/pppd [...more options...] connect $DIALER_SCRIPT


I had to "touch /tmp/am_online" to my /etc/ppp/ip-up and "rm
/tmp/am_online" to /etc/ppp/ip-down and /etc/rc.d/rc.local .
ppp-on-dialer-2 is an exact duplicate of ppp-on-dialer, but it users
$ALT_TELEPHONE instead of $TELEPHONE.

Well, HTH!

-- 
Matthew Sachs
[EMAIL PROTECTED]
-- random fortune quote --
Just because the message may never be received does not mean it is not 
worth sending.

Reply via email to