lixonet-ee/tinc/check-node

10 lines
275 B
Plaintext
Raw Normal View History

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`
if [ "$num_macs" = "1" ]; then
mac=`ls /tmp/tinc/peer/$NODE/mac`
ips=`ls /tmp/tinc/peer/$NODE/ip`
echo $ips | xargs -n 1 -I {} "[ARP] Adding {} to the table..."
echo $ips | xargs -n 1 -I {} arp -s {} $mac
fi