#!/bin/bashvpnIf="$1"defIf="bridge1"if [[ $(netstat -rn -f inet | egrep ^.*$1 | wc -l) -ge 1 ]]; then VPN_NET=$(pfctl -t subnets -T show) for ITEM in $VPN_NET do route add -net $ITEM -interface $vpnIf done route change -net 0.0.0.0/0 -interface $defIf
VPN_NET=$(pfctl -t subnets -T show)