2024-11-05 17:33:17 -07:00

8 lines
285 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?"