8 lines
227 B
Bash

#!/bin/sh
gateway=`nslookup tinc | awk -F': ' 'NR==6 { print \$2 } '`
route="${network_address}/${global_prefix:-16}"
iface="eth0"
echo "Routing \$route to \$gateway via \$iface"
ip route add \$route via \$gateway dev \$iface