]> git.decadent.org.uk Git - odhcp6c.git/blobdiff - debian/odhcp6c.ppp.ipv6-down
Add preliminary PPP hook scripts
[odhcp6c.git] / debian / odhcp6c.ppp.ipv6-down
diff --git a/debian/odhcp6c.ppp.ipv6-down b/debian/odhcp6c.ppp.ipv6-down
new file mode 100755 (executable)
index 0000000..89a8967
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+IFACE="$1"
+PID="$(cat "/run/odhcp6c.$IFACE.pid" 2>/dev/null)"
+
+# Was a pid recorded and does the process still exist?
+# XXX should check process name too
+if [ -n "$PID" ] && kill -0 $PID; then
+       # XXX this doesn't currently remove the pid file
+       kill $PID
+else
+       rm -f "/run/odhcp6c.$IFACE.pid"
+fi