add tinc-down.local hook

This commit is contained in:
root 2015-02-09 08:37:14 +00:00
parent 5852ac2650
commit 5127847eff
3 changed files with 5 additions and 3 deletions

1
.gitignore vendored
View File

@ -4,3 +4,4 @@ ed25519_key.priv
tinc.conf tinc.conf
tincrc tincrc
tinc-up.local tinc-up.local
tinc-down.local

View File

@ -21,4 +21,5 @@ elif has dhclient; then
elif [[ "$OSTYPE" == "darwin"* ]]; then # TODO untested elif [[ "$OSTYPE" == "darwin"* ]]; then # TODO untested
ipconfig set "$interface" NONE ipconfig set "$interface" NONE
fi fi
exit 0
[ -x "${DIR}/tinc-down.local" ] && "${DIR}/tinc-down.local" || true

View File

@ -131,7 +131,7 @@ if [ -n "$SUBNET" ]; then
IFS=' ' read ip netmask <<< "$SUBNET" IFS=' ' read ip netmask <<< "$SUBNET"
[ -z "$ip" ] && die "no ip set in SUBNET" [ -z "$ip" ] && die "no ip set in SUBNET"
[ -z "$netmask" ] && die "no netmask set in SUBNET" [ -z "$netmask" ] && die "no netmask set in SUBNET"
set_ip "$INTERFACE" "$IP" "$NETMASK" set_ip "$INTERFACE" "$ip" "$netmask"
fi fi
if [ "${DHCP,,}" = "yes" ]; then if [ "${DHCP,,}" = "yes" ]; then
@ -142,4 +142,4 @@ if [[ "${IPV6_PRIVACY,,}" != "yes" ]]; then
disable_ipv6_privacy "$INTERFACE" disable_ipv6_privacy "$INTERFACE"
fi fi
[ -x "$LOCAL_HOOK_FILE" ] && "$LOCAL_HOOK_FILE" || true [ -x "${DIR}/tinc-up.local" ] && "${DIR}/tinc-up.local" || true