From c91371c2b8036add5cfd4f1223dfcf4a00449b9c Mon Sep 17 00:00:00 2001 From: Manevolent Date: Wed, 12 Apr 2023 23:58:33 -0600 Subject: [PATCH] Update subnet-down.tmpl --- tinc/subnet-down.tmpl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tinc/subnet-down.tmpl b/tinc/subnet-down.tmpl index 5ea9f19..794774a 100644 --- a/tinc/subnet-down.tmpl +++ b/tinc/subnet-down.tmpl @@ -1,17 +1,17 @@ #!/bin/ash echo "Route down: \$SUBNET weight \$WEIGHT via \$NODE (\$REMOTEADDRESS:\$REMOTEPORT)" nonMACChars=`echo \$SUBNET | tr -d "[:digit:]" | tr -d [:ABCDEFabcdef]` -macFile="/tmp/tinc_peer_mac_\$NODE" +date=`date -u` + if [ -z "\$nonMACChars" ]; then # This subnet is a MAC - if test -f "\$macFile"; then - rm \$macFile - fi + rm /tmp/tinc_peer_mac_\$NODE_\$SUBNET else + # This subnet is an IP address if echo "\$SUBNET" | grep -q -E ".+/32\$"; then - # This subnet is likely an IP address, remove it from the ARP table address=`echo "\$SUBNET" | cut -d '/' -f 1` - echo "Unmapping \$address <=> \$mac from ARP table" - arp -d "\$address" + rm /tmp/tinc_peer_mac_\$NODE_\$address fi fi + +./check-node