Update subnet-down.tmpl
This commit is contained in:
parent
92ae69cb63
commit
c91371c2b8
@ -1,17 +1,17 @@
|
|||||||
#!/bin/ash
|
#!/bin/ash
|
||||||
echo "Route down: \$SUBNET weight \$WEIGHT via \$NODE (\$REMOTEADDRESS:\$REMOTEPORT)"
|
echo "Route down: \$SUBNET weight \$WEIGHT via \$NODE (\$REMOTEADDRESS:\$REMOTEPORT)"
|
||||||
nonMACChars=`echo \$SUBNET | tr -d "[:digit:]" | tr -d [:ABCDEFabcdef]`
|
nonMACChars=`echo \$SUBNET | tr -d "[:digit:]" | tr -d [:ABCDEFabcdef]`
|
||||||
macFile="/tmp/tinc_peer_mac_\$NODE"
|
date=`date -u`
|
||||||
|
|
||||||
if [ -z "\$nonMACChars" ]; then
|
if [ -z "\$nonMACChars" ]; then
|
||||||
# This subnet is a MAC
|
# This subnet is a MAC
|
||||||
if test -f "\$macFile"; then
|
rm /tmp/tinc_peer_mac_\$NODE_\$SUBNET
|
||||||
rm \$macFile
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
|
# This subnet is an IP address
|
||||||
if echo "\$SUBNET" | grep -q -E ".+/32\$"; then
|
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`
|
address=`echo "\$SUBNET" | cut -d '/' -f 1`
|
||||||
echo "Unmapping \$address <=> \$mac from ARP table"
|
rm /tmp/tinc_peer_mac_\$NODE_\$address
|
||||||
arp -d "\$address"
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
./check-node
|
||||||
|
Loading…
x
Reference in New Issue
Block a user