8 lines
286 B
Bash
8 lines
286 B
Bash
#!/bin/sh
|
|
gateway=`getent ahostsv4 tinc | awk '{ print \$1 }' | head -n 1`
|
|
route="${network_address}/${global_prefix:-16}"
|
|
iface="eth0"
|
|
|
|
echo "Routing \$route to \$gateway via \$iface"
|
|
ip route add \$route via \$gateway dev \$iface || echo "Failed to add route; does it already exist?"
|