Update lixonet.sh.tmpl

This commit is contained in:
Manevolent 2024-02-23 17:34:19 -07:00 committed by GitHub
parent 2c1beade8a
commit ac1d71f808
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,7 +1,7 @@
#!/bin/sh
gateway=`nslookup tinc | awk -F': ' 'NR==6 { print \$2 } '`
gateway=`getent hosts tinc | awk '{ print $1 }'`
route="${network_address}/${global_prefix:-16}"
iface="eth0"
echo "Routing \$route to \$gateway via \$iface"
ip route add \$route via \$gateway dev \$iface
ip route add \$route via \$gateway dev \$iface || echo "Failed to add route; does it already exist?"