diff options
author | James Rayner <james@rayner.id.au> | 2010-11-21 03:11:46 +0100 |
---|---|---|
committer | James Rayner <james@rayner.id.au> | 2010-11-21 03:11:46 +0100 |
commit | 6b43b99662e82534388b34258e140374a439dccf (patch) | |
tree | a0946cf460f0cc58870a96ad035b81eeac77e6f1 | |
parent | 0fc35b1462b3257653ebca6d2df65a6062a2194a (diff) | |
download | netctl-6b43b99662e82534388b34258e140374a439dccf.tar.gz netctl-6b43b99662e82534388b34258e140374a439dccf.tar.xz |
FS#20569 - cleaner handling of ppp disconnection
-rw-r--r-- | src/connections/ppp | 8 |
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" |