Example ppp-off Script
# ppp-off -- shutdown a running ppp daemon
# this was taken directly from the pppd-2.1.2d Linux FAQ
if [ -n "$1" ]; then
# exit sts
# If the pid file is present then pppd is running. Stop it.
if [ -r $piddir/$pppdev.pid ]; then
if kill -INT `cat $piddir/$pppdev.pid`; then
# Success. Let pppd clean up its own junk.
echo "$0: ppp link to $pppdev terminated."
# 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.
rm -f $piddir/$pppdev.pid
echo "$0: Removed stale pid file"
# The ppp process is not running for ppp0
echo "$0: no ppp link is active on $pppdev"
# exit with appropriate status
Copyright © 1994 - 2017 Linux Journal. All rights reserved.