2023-04-13 00:35:31 -06:00
|
|
|
#!/bin/ash
|
2023-04-13 01:02:43 -06:00
|
|
|
|
|
|
|
num_macs=`ls /tmp/tinc/peer/$NODE/mac | wc -l`
|
2023-04-13 01:13:24 -06:00
|
|
|
num_ips=`ls /tmp/tinc/peer/$NODE/ip | wc -l`
|
2023-04-13 01:02:43 -06:00
|
|
|
if [ "$num_macs" = "1" ]; then
|
2023-04-13 01:14:49 -06:00
|
|
|
if [ "$num_ips" = "0" ]; then
|
2023-04-13 01:16:16 -06:00
|
|
|
exit 0
|
2023-04-13 01:11:22 -06:00
|
|
|
fi
|
|
|
|
|
2023-04-13 01:02:43 -06:00
|
|
|
mac=`ls /tmp/tinc/peer/$NODE/mac`
|
|
|
|
ips=`ls /tmp/tinc/peer/$NODE/ip`
|
2023-04-13 01:14:33 -06:00
|
|
|
echo $ips | xargs -n 1 -I {} echo "[ARP] Adding {} <=> $mac to the table..."
|
2023-04-13 01:02:43 -06:00
|
|
|
echo $ips | xargs -n 1 -I {} arp -s {} $mac
|
|
|
|
fi
|