From: gregor herrmann Date: Thu, 6 Aug 2015 22:40:07 +0000 (+0200) Subject: add /etc/network/if-up.d/ example X-Git-Url: https://git.toastfreeware.priv.at/toast/tdyndns.git/commitdiff_plain/8368008d3fee4e1535c3b2f397067cbfb8a751fa add /etc/network/if-up.d/ example --- diff --git a/bin/tdyndns-ifupdown b/bin/tdyndns-ifupdown new file mode 100755 index 0000000..2c4cf90 --- /dev/null +++ b/bin/tdyndns-ifupdown @@ -0,0 +1,31 @@ +#!/bin/sh + +# save as /etc/network/if-up.d/tdyndns + +# man 5 interfaces: +# IFACE physical name of the interface being processed +# LOGICAL logical name of the interface being processed +# ADDRFAM address family of the interface +# METHOD method of the interface (e.g., static) +# MODE start if run from ifup, stop if run from ifdown +# PHASE as per MODE, but with finer granularity, distinguishing the pre-up, post-up, pre-down and post-down phases. +# VERBOSITY indicates whether --verbose was used; set to 1 if so, 0 if not. +# PATH the command search path: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + +set -e + +[ -n "$IFACE" ] +[ -n "$MODE" ] +[ "$MODE" = "start" ] || exit 0 +[ -x /usr/local/bin/tdyndns ] || exit 0 + +case "$IFACE" in + eth*|ath*|wlan*|ppp*|wwan*) + [ "$VERBOSITY" = "1" ] && echo "Interface $IFACE started, calling tdyndns." + /usr/local/bin/tdyndns & + ;; + *) + ;; +esac + +exit 0