modem & setserial (auto dialup out there?)
First: I could swear there was a script floating around
to have your machine dial up your ISP & email the IP
address to you. I thought it was in an early issue of
Linux Gazette. Does anyone know if & where I might find
such a creature?
I'd write it myself, except I'm frustrated with my ppp
dial up script as it is. It worked fine under some old
slackware distribution, but when I upgraded completely
to Debian hamm (I now run slink) I began having one minor
problem: after dialing up & turning off the connection
the modem would be 'hung' and I have to run the hylafax
probemodem script.
Last night I read some man pages (very large thankyou to
those involved with setting up the HTML documentation
structure) and thought I discovered the problem in the
closing_waits of setserial. closing_wait2seems 'stuck'
at infinte.
Anyhow, I'm attaching the setserial output and my ppp
scripts. TIA!!!
Cheers,
judith
Immediately after turning on my machine:
< 103 5:50am grey-cat:~> setserial /dev/ttyS2 -a
/dev/ttyS2, Line 2, UART: 16550A, Port: 0x03e8, IRQ: 4
Baud_base: 115200, close_delay: 50, divisor: 0
closing_wait: 3000, closing_wait2: infinte
Flags: spd_normal skip_test
grey-cat:~# setserial /dev/ttyS2 closing_wait none closing_wait2 3000
grey-cat:~# setserial -a /dev/ttyS2
/dev/ttyS2, Line 2, UART: 16550A, Port: 0x03e8, IRQ: 4
Baud_base: 115200, close_delay: 50, divisor: 0
closing_wait: none, closing_wait2: infinte
Flags: spd_normal skip_test
#####################################################################
#! /bin/tcsh
#####################################################################
set PPPDIR=/etc/ppp
#--------------------------------------------------------------------
# Customizing Section
#--------------------------------------------------------------------
set ID = MN1
set IDst = "MN1"
set PHONE=12159651902
set USER=greycat@martnet.com
set DEBUG=15
#--------------------------------------------------------------------
set name = ppp-on-$ID
set EXEC=/usr/sbin
set DEVICE=ttyS2
set IRQ=5
set CONNECT=1
set chat="-did not execute-."
set flag = ""
set pppdflag = ""
if ($DEBUG == 5) set flag = "-V"
if ($DEBUG == 15) set pppdflag = "debug"
if ($DEBUG == 15) set flag = "-V"
#--------------------------------------------------------------------
if ($1 == "-h") then
echo " $IRQ closing_wait none closing_wait2 3000
chown root /dev/$DEVICE
chmod 666 /dev/$DEVICE
stty -F /dev/$DEVICE sane
stty -F /dev/$DEVICE 38400 -tostop crtscts -ixon
echo $name": PPP call, connecting to "$IDst
($EXEC/chat $flag SAY "CHATTING\n" \
REPORT CONNECT \
ABORT "NO CARRIER" \
ABORT "BUSY" \
"" AT\&F\&C1\&D2 \
OK ATDT$PHONE \
CONNECT "" ) < /dev/$DEVICE >
/dev/$DEVICE
set chat = $status
if ($DEBUG >= 5) echo "\n"
if ($DEBUG >= 2) echo $name": chat returns "$chat
if ( $chat == 0 ) then
if ( $DEBUG >= 2 ) echo $name": Chat successful"
$EXEC/pppd /dev/$DEVICE 115200 $pppdflag modem crtscts noipdefault user
$USER < /dev/$DEVICE > /dev/$DEVICE &
elseif ( $chat == 4 ) then
echo $name": Chat failed because there was no dial tone."
echo "\t\t(Check for messages)"
elseif ( $chat == 5 ) then
echo $name": Chat failed on because the line was busy."
else
echo $name": Chat failed on with value "$chat"."
endif
echo $name": End of "$name" script."
#####################################################################
#####################################################################
#! /bin/tcsh
#####################################################################
set name = ppp-off
set vs = "vs1.1 linux"
set date = "970601 JEB"
set PPPDIR=/etc/ppp
set debug = 0
#--------------------------------------------------------------------
# Customizing Section
#--------------------------------------------------------------------
#--------------------------------------------------------------------
set P_LOCKDIR=/var/run
set P_DEVICE=ppp
# If the ppp0 pid file is present then the program is running. Stop it.
if ( -r $P_LOCKDIR/${P_DEVICE}*.pid ) then
if ($debug >= 10) then
cat $P_LOCKDIR/${P_DEVICE}*.pid
ls -l $P_LOCKDIR/
endif
kill -INT `cat $P_LOCKDIR/${P_DEVICE}*.pid`
set dead = $status
# If unsuccessful, ensure that the pid file is removed.
if ($dead != 0) then
echo $name": removing stale ${P_DEVICE} pid file."
rm -f $P_LOCKDIR/${P_DEVICE}*.pid
exit 1
endif
# Success. Terminate with proper status.
echo $name": $P_DEVICE link terminated"
exit 0
endif
# The link is not active
echo $name": $P_DEVICE link is not active"
exit 1
--
Judith E. Bush judith@greycat.net
P O Box 7559 AOL IM judielaine
Philadelphia PA 19101
Reply to: