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

Modem strings / Multiple isp numbers (was: Re: Uploaded pppupd 0.23-1)



Seeing this thread just reminded me of something.  I've been working on
some ppp scripts and got pretty far.  Unfortunately, I wasn't able to
correctly reset the modem between dials.  Now if anything funny happens
between dials, it just hangs until I pull up another program that will
reset the modem (kermit or minicom).  I'm back at school now, and I'm on
the ethernet now, so if someone wants to take over, be my guest (but give
me some credit if it gets used).

Scripts appended to the end of this message,
Brandon

-----
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

----/usr/bin/pon----
#!/bin/sh
if [ -r /etc/ppp.options_out -a -r /etc/ppp.chatscript ]; then
  /usr/sbin/pppd connect "/etc/ppp/multi-chat.sh $*" `cat /etc/ppp.options_out`
#                         ^^^^^^^^^^^^^^^^^^^^^^^^^
else
  echo "You do not have permissions to access /etc/ppp.chatscript or /etc/ppp.options_out"
fi

----/etc/ppp/multi-chat.sh----
#!/bin/sh

# By Brandon Mitchell (bhmit1@mail.wm.edu)

# if a script is specified, try it, but only once
# if the connection dies, ppp will restart it with the correct options
echo "/etc/ppp/scripts/$0" > /tmp/ch.out
if [ "x$1" != "x" -a -r "/etc/ppp/scripts/$1" ]; then
  /usr/sbin/chat -v -f "/etc/ppp/scripts/$1" && exit 0 || exit 1
fi

# otherwise, cycle through all scripts forever
while true; do
  for i in /etc/ppp/scripts/*; do
    /usr/sbin/chat -v -f $i && exit 0
#    This next section is the problem, it should probably be a chatscript
#    e.g. /etc/ppp/reset.chat
#    echo "+++"
#    read x     # OK
#    echo "ATH0"
#    read y     # NO CONNECT
    sleep 10
  done
done

----/etc/ppp/scripts/chat.1----
# I think you know how to make more of these
ABORT        BUSY
ABORT        "NO CARRIER"
ABORT        VOICE
ABORT	     "NO DIALTONE"
ABORT	     "Account in Use"
""           ATDT-YOUR_ISP_NUMBER
ogin         YOUR_USER_ID
word         \qYOUR_PASSWORD
TIMEOUT      5
PPP	     



--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: