summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Rayner <james@rayner.id.au>2010-11-21 03:11:46 +0100
committerJames Rayner <james@rayner.id.au>2010-11-21 03:11:46 +0100
commit6b43b99662e82534388b34258e140374a439dccf (patch)
treea0946cf460f0cc58870a96ad035b81eeac77e6f1
parent0fc35b1462b3257653ebca6d2df65a6062a2194a (diff)
downloadnetctl-6b43b99662e82534388b34258e140374a439dccf.tar.gz
netctl-6b43b99662e82534388b34258e140374a439dccf.tar.xz
FS#20569 - cleaner handling of ppp disconnection
-rw-r--r--src/connections/ppp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/connections/ppp b/src/connections/ppp
index 4a9b218..a82677b 100644
--- a/src/connections/ppp
+++ b/src/connections/ppp
@@ -17,7 +17,13 @@ ppp_up() {
ppp_down() {
load_profile "$1"
- kill "$(head -1 "/var/run/ppp-$(basename $PEER).pid")"
+ PIDFILE="/var/run/ppp-$(basename $PEER).pid"
+
+ if [[ -e $PIDFILE ]]; then
+ PID=$(head -1 $PIDFILE)
+ [[ -n "$PID" ]] && kill "$(head -1 $PIDFILE)"
+ fi
+ kill "$(head -1 $PIDFILE)"
}
ppp_$1 "$2"