[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RE: Multiple PPP Configurations

> >Is there a way to have more than one pppd configuration? Getting another
> >modem is not an option.
> >
> >What I would like is something along these lines:
> >       pon work
> >       poff
> >       pon internet

I've got just the thing for you!  I wrote it to dial several isp numbers
finding a non-busy one.

The attached is a work in progress.  Unfortunately, it will not progress
any further until I'm back for winter break (have an ethernet connection
at school).  If anyone else wants to take care of it (or report bugs),
just let me know.  Note, I sent this to the ppp maintainer, but he is more
interested in developing some other (probably better) scheme.


P.S. Important directory, /etc/ppp/scripts.  You probably want one called
work and one called internet.  Note, the sleep 3 is what I'm not sure
about.  It had a habbit of not hanging up completely on bad connections.

Brandon Mitchell                         E-mail: bhmit1@mail.wm.edu
  Homepage: http://www.geocities.com/SiliconValley/7877/home.html
                  PGP: finger -l bhmit1@cs.wm.edu                 
"We all know Linux is great...it does infinite loops in 5 seconds."
	--Linus Torvalds

bhmit1@hobbes(p1):bhmit1$ more /usr/bin/pon
if [ -r /etc/ppp.options_out -a -r /etc/ppp.chatscript ]; then
  /usr/sbin/pppd connect "/etc/ppp/multi-chat.sh $*" `cat \
#                         ^^^^^^^^^^^^^^^^^^^^^^^^^
  echo "You do not have permissions to access /etc/ppp.chatscript or \

bhmit1@hobbes(p1):bhmit1$ more /etc/ppp/multi-chat.sh 

# The following is by: Brandon Mitchell <bhmit1@mail.wm.edu>
# Feel free to distribute or modify, however, send me copies of 
# any improvements please.  If it breaks, you get to keep both 
# pieces.

# poff is good enough to kill either of these.

# if a script is specified, try it, but only once
# ppp will keep trying this script with the same parameters if 
# there are problems
echo "/etc/ppp/scripts/$0" > /tmp/ch.out
if [ "x$1" != "x" -a -r "/etc/ppp/scripts/$1" ]; then
  /usr/sbin/chat -v -t 20 -f "/etc/ppp/scripts/$1" && exit 0 || exit 1

# otherwise, cycle through all scripts forever
while true; do
  for i in /etc/ppp/scripts/*; do
    /usr/sbin/chat -v -t 30 -f $i && exit 0
    echo "+++"  # Command mode
    read x      # Read "OK"
    sleep 3     # I'm working on this
    echo "ATH0" # Hangup
    read y      # Read "NO CONNECT"
    sleep 5     # Give the phone some time

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: