From cfcc4d1393c5563418c620117f8cc8ce9644876b Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sat, 6 Feb 2016 02:36:40 +0000 Subject: [PATCH] Add preliminary PPP hook scripts --- debian/odhcp6c.ppp.ipv6-down | 12 ++++++++++++ debian/odhcp6c.ppp.ipv6-up | 4 ++++ debian/rules | 7 +++++++ 3 files changed, 23 insertions(+) create mode 100755 debian/odhcp6c.ppp.ipv6-down create mode 100755 debian/odhcp6c.ppp.ipv6-up 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 -- 2.39.2