#!/bin/sh # # Bring down the ppp connection # # @(#) $Id: ppp-off,v 1.3 1999/01/29 18:18:18 myers Exp myers $ ###################################################################### # Determine the device to be terminated. # if [ "$1" = "" ]; then DEVICE=ppp0 else DEVICE=$1 fi ###################################################################### # If the ppp0 pid file is NOT present then the program is not running. if [ ! -r /var/run/$DEVICE.pid ]; then echo "ERROR: PPP link is not active on $DEVICE" exit 1 fi ######################################################################## # Things to do before the link goes down. (The ip-down script will # run, if it exists, AFTER the link goes down.) /usr/lib/sendmail -q /usr/local/bin/ntpdate surprise.ifs.umich.edu maui.physics.lsa.umich.edu 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