-
Notifications
You must be signed in to change notification settings - Fork 5
/
ppp-off
43 lines (42 loc) · 914 Bytes
/
ppp-off
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
42
43
#!/bin/bash
###################################
#
# ppp-off
#
# Linux PPP HOWTO
# Robert Hart 31.03.1997
# Translated by Ilgiz Kalmetev
#
# Opredelit preryvaemoe ustroistvo
#
if [ "$1" = "" ]; then
DEVICE=ppp0
else
DEVICE=$1
fi
####################################
#
# Esly pid-file ppp() yest, togda programma rabotaet.
# Ostanovit ee.
if [ -e /var/run/$DEVICE.pid ]; then
kill `cat /var/run/$DEVICE.pid`
echo "OK"
#
# Esly kill ne rabotaet, togda net processa,
# zapushennogo pod etim pid.
# ili sushestvuet postoronnii lock-file.
# popytka ego udalit
if [ ! "$?" = "0" ]; then
rm -f /var/run/$DEVICE.pid
echo "ERROR: Removed stale pid file."
exit 1
fi
#
# Otlichno. Pust pppd popravit svoi nedo4et.
echo "PPP link to $DEVICE terminated."
exit 0
fi
#
# ppp process ne zapushen dlya ppp()
echo "ERROR: PPP link is not active on $DEVICE"
exit 1