add /etc/network/if-up.d/ example
authorgregor herrmann <gregoa@debian.org>
Thu, 6 Aug 2015 22:40:07 +0000 (00:40 +0200)
committergregor herrmann <gregoa@debian.org>
Thu, 6 Aug 2015 22:40:07 +0000 (00:40 +0200)
bin/tdyndns-ifupdown [new file with mode: 0755]

diff --git a/bin/tdyndns-ifupdown b/bin/tdyndns-ifupdown
new file mode 100755 (executable)
index 0000000..2c4cf90
--- /dev/null
@@ -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