lixonet-ee/tinc/check-node

15 lines
376 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`
2023-04-13 01:11:22 -06:00
num_ips=`ls /tmp/tinc/peer/$NODE/ips | wc -l`
2023-04-13 01:02:43 -06:00
if [ "$num_macs" = "1" ]; then
2023-04-13 01:11:22 -06:00
if [ "$num_ips" = "0"]; then
exit 1
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:06:04 -06:00
echo $ips | xargs -n 1 -I {} echo "[ARP] Adding {} to the table..."
2023-04-13 01:02:43 -06:00
echo $ips | xargs -n 1 -I {} arp -s {} $mac
fi