ppp-off sample?

ppp-off sample?

Post by Alan Scre » Mon, 06 Jan 1997 04:00:00



I'm trying to setup my Linux box as a PPP "client".  I'm
using the Debian 1.2 distribution, and for some reason it
didn't have any of the PPP scripts include (e.g., ppp-on,
ppp-off).  I was able to write the ppp-on script based on
the PPP-HOWTO; however, the howto didn't describe what was
done in the ppp-off script.  What do I need to put in it?

----------------------------------------------------------------
Alan Screen                    | Phone:  (416) 736-0900 ext. 287
Array Systems Computing Inc.   | Fax:    (416) 736-4715


Canada   (eh?)                 | "I'd rather be skiing!!"

 
 
 

ppp-off sample?

Post by Theo Van Dinte » Tue, 07 Jan 1997 04:00:00


-----BEGIN PGP SIGNED MESSAGE-----


> I'm trying to setup my Linux box as a PPP "client".  I'm
> using the Debian 1.2 distribution, and for some reason it
> didn't have any of the PPP scripts include (e.g., ppp-on,
> ppp-off).  I was able to write the ppp-on script based on
> the PPP-HOWTO; however, the howto didn't describe what was
> done in the ppp-off script.  What do I need to put in it?

Well, here's a copy of the pppup and pppdn scripts that I wrote for my
connection over the summer...  Hope it helps.

 ---- pppup ----
#!/bin/sh
/usr/sbin/pppd connect 'chat ABORT "NO CARRIER" ABORT BUSY "" ATM0DT[NUMBER] CONNECT "" ogin: [USERNAME] assword: [PASSWORD]'

 ---- pppdn ----
#!/bin/sh

DEVICE=ppp0

#
# If the ppp0 pid file is present then the program is running. Stop it.
if [ -r /var/run/$DEVICE.pid ]; then
        kill -INT `cat /var/run/$DEVICE.pid`

#
# If unsuccessful, ensure that the pid file is removed.
#
        if [ ! "$?" = "0" ]; then
                echo "removing stale $DEVICE pid file."
                rm -f /var/run/$DEVICE.pid
                exit 1
        fi
#
# Success. Terminate with proper status.
#
        echo "$DEVICE link terminated"
        exit 0
fi
#
# The link is not active
#
echo "$DEVICE link is not active"
exit 1

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQB1AwUBMtGBRm46V+hEhqEhAQHrWgL/edbKDwEXI0vbr7ZmQIvEjGBQI3CBqAQD
0Ms3wnFucR+Q/d29HU7uAdGTK1QtoylYDy4ybUCIMyuwX5yzcsOT6PDWfe4SzGOQ
rbPZgRBmgi8AIO2tepwZwpsYvRCwlvDD
=kOzy
-----END PGP SIGNATURE-----

 
 
 

ppp-off sample?

Post by Steve Atwe » Thu, 09 Jan 1997 04:00:00



>I'm trying to setup my Linux box as a PPP "client".  I'm
>using the Debian 1.2 distribution, and for some reason it
>didn't have any of the PPP scripts include (e.g., ppp-on,
>ppp-off).  I was able to write the ppp-on script based on
>the PPP-HOWTO; however, the howto didn't describe what was
>done in the ppp-off script.  What do I need to put in it?

This is what mine has in it (Slackware):

-------------------CUT HERE--------------------
#!/bin/sh
######################################################################
#
# Determine the device to be terminated.
#
if [ "$1" = "" ]; then
        DEVICE=ppp0
else
        DEVICE=$1
fi

######################################################################
#
# If the ppp0 pid file is present then the program is running. Stop it.
if [ -r /var/run/$DEVICE.pid ]; then
        kill -INT `cat /var/run/$DEVICE.pid`
#
# If the kill did not work then there is no process running for this
# pid. It may also mean that the lock file will be left. You may wish
# to delete the lock file at the same time.
        if [ ! "$?" = "0" ]; then
                rm -f /var/run/$DEVICE.pid
                echo "ERROR: Removed stale pid file"
                exit 1
        fi
#
# Success. Let pppd clean up its own junk.
        echo "PPP link to $DEVICE terminated."
        exit 0
fi
#
# The ppp process is not running for ppp0
echo "ERROR: PPP link is not active on $DEVICE"
exit 1
-------------------CUT HERE--------------------

--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Web Page     - http://www.prairienet.org/~satwell
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=