File: ppp-off

package info (click to toggle)
doc-linux-nl 20051127-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 16,408 kB
  • ctags: 94
  • sloc: xml: 47,403; makefile: 312; perl: 193; sh: 116; ansic: 12; csh: 9
file content (41 lines) | stat: -rw-r--r-- 1,072 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/sh
#echo " Telling ML.ORG were going offline"
#	mlddc d</etc/ppp/mlddc/mymldata
#	hostname HeliuM.smaal.nl

######################################################################
#
# 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."

echo "Done"
exit 0

fi
#
# The ppp process is not running for ppp0
echo "ERROR: PPP link is not active on $DEVICE"
exit 1