lixonet-ee/tinc/subnet-down.tmpl

18 lines
483 B
Cheetah
Raw Normal View History

2020-04-28 00:17:03 +00:00
#!/bin/ash
2023-04-12 21:37:30 -06:00
echo "Route down: \$SUBNET weight \$WEIGHT via \$NODE (\$REMOTEADDRESS:\$REMOTEPORT)"
2023-04-12 22:49:10 -06:00
nonMACChars=`echo \$SUBNET | tr -d "[:digit:]" | tr -d [:ABCDEFabcdef]`
2023-04-12 23:58:33 -06:00
date=`date -u`
2023-04-12 22:49:10 -06:00
if [ -z "\$nonMACChars" ]; then
# This subnet is a MAC
2023-04-12 23:58:33 -06:00
rm /tmp/tinc_peer_mac_\$NODE_\$SUBNET
2023-04-12 22:49:10 -06:00
else
2023-04-12 23:58:33 -06:00
# This subnet is an IP address
2023-04-12 22:49:10 -06:00
if echo "\$SUBNET" | grep -q -E ".+/32\$"; then
address=`echo "\$SUBNET" | cut -d '/' -f 1`
2023-04-12 23:58:33 -06:00
rm /tmp/tinc_peer_mac_\$NODE_\$address
2023-04-12 22:49:10 -06:00
fi
fi
2023-04-12 23:58:33 -06:00
./check-node