2020-04-28 00:17:03 +00:00
|
|
|
#!/bin/ash
|
2023-04-12 21:36:42 -06:00
|
|
|
echo "Route up: \$SUBNET weight \$WEIGHT via \$NODE (\$REMOTEADDRESS:\$REMOTEPORT)"
|
2023-04-12 22:28:42 -06:00
|
|
|
nonMACChars=`echo \$SUBNET | tr -d "[:digit:]" | tr -d [:ABCDEF]`
|
|
|
|
macFile="/tmp/tinc_peer_mac_\$NODE"
|
|
|
|
if [ -z "\$nonMACChars" ]; then
|
|
|
|
# This subnet is a MAC
|
|
|
|
echo "\$SUBNET" > \$macFile
|
|
|
|
else
|
|
|
|
# This subnet is likely an IP address, add it to the ARP table
|
|
|
|
mac=`cat \$macFile`
|
|
|
|
arp -s "\$SUBNET" "\$mac"
|
|
|
|
fi
|