From 5127847eff9d319e97e263055151ff8431ceca91 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 9 Feb 2015 08:37:14 +0000 Subject: [PATCH] add tinc-down.local hook --- .gitignore | 1 + tinc-down | 3 ++- tinc-up | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 7bce376..25417d4 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ ed25519_key.priv tinc.conf tincrc tinc-up.local +tinc-down.local diff --git a/tinc-down b/tinc-down index 74d0df9..f821ba1 100755 --- a/tinc-down +++ b/tinc-down @@ -21,4 +21,5 @@ elif has dhclient; then elif [[ "$OSTYPE" == "darwin"* ]]; then # TODO untested ipconfig set "$interface" NONE fi -exit 0 + +[ -x "${DIR}/tinc-down.local" ] && "${DIR}/tinc-down.local" || true diff --git a/tinc-up b/tinc-up index 4fa27d3..a860bc2 100755 --- a/tinc-up +++ b/tinc-up @@ -131,7 +131,7 @@ if [ -n "$SUBNET" ]; then IFS=' ' read ip netmask <<< "$SUBNET" [ -z "$ip" ] && die "no ip set in SUBNET" [ -z "$netmask" ] && die "no netmask set in SUBNET" - set_ip "$INTERFACE" "$IP" "$NETMASK" + set_ip "$INTERFACE" "$ip" "$netmask" fi if [ "${DHCP,,}" = "yes" ]; then @@ -142,4 +142,4 @@ if [[ "${IPV6_PRIVACY,,}" != "yes" ]]; then disable_ipv6_privacy "$INTERFACE" fi -[ -x "$LOCAL_HOOK_FILE" ] && "$LOCAL_HOOK_FILE" || true +[ -x "${DIR}/tinc-up.local" ] && "${DIR}/tinc-up.local" || true