From: Ben Hutchings Date: Sat, 6 Feb 2016 02:36:40 +0000 (+0000) Subject: Add preliminary PPP hook scripts X-Git-Tag: debian/1.1+git20160131-1~3 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=cfcc4d1393c5563418c620117f8cc8ce9644876b;p=odhcp6c.git Add preliminary PPP hook scripts --- diff --git a/debian/odhcp6c.ppp.ipv6-down b/debian/odhcp6c.ppp.ipv6-down new file mode 100755 index 0000000..89a8967 --- /dev/null +++ b/debian/odhcp6c.ppp.ipv6-down @@ -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 diff --git a/debian/odhcp6c.ppp.ipv6-up b/debian/odhcp6c.ppp.ipv6-up new file mode 100755 index 0000000..26bdf3a --- /dev/null +++ b/debian/odhcp6c.ppp.ipv6-up @@ -0,0 +1,4 @@ +#!/bin/sh +IFACE="$1" +# XXX Options need to be configurable +odhcp6c -P 0 -d -v -f -p "/run/odhcp6c.$IFACE.pid" "$IFACE" diff --git a/debian/rules b/debian/rules index 2d33f6a..afe0e45 100755 --- a/debian/rules +++ b/debian/rules @@ -2,3 +2,10 @@ %: dh $@ + +override_dh_install: + dh_install + install -D -m755 debian/odhcp6c.ppp.ipv6-up \ + debian/odhcp6c/etc/ppp/ipv6-up.d/odhcp6c + install -D -m755 debian/odhcp6c.ppp.ipv6-down \ + debian/odhcp6c/etc/ppp/ipv6-down.d/odhcp6c