Browse Source

Fixed up in ip table entries

Joachim M. Giæver 5 years ago
parent
commit
d76896dafb
1 changed files with 6 additions and 1 deletions
  1. 6 1
      aiop/aiop-openvpn

+ 6 - 1
aiop/aiop-openvpn

@@ -25,7 +25,12 @@ route_vpn () {
     fi
 
     ip route show table main | grep -Ev ^default | while read ROUTE; do
-        cmd_run "ip-route" "ip route add table ${RTABLE} ${ROUTE}" "-nolog"
+        # Remote interface != ${IFACE_TUN} && != ${IFACE} entries from this table.
+        if [ $(echo "${ROUTE}" | grep -ice "tun") -eq 0 ] || [ $(echo "${ROUTE}" | grep -ice "${IFACE_TUN}") -ne 0 ]; then
+            if [ $(echo "${ROUTE}" | grep -icE "wl[0-9]\.[0-9]") -eq 0 ] || [ $(echo "${ROUTE}" | grep -ice "${IFACE}") -ne 0 ]; then
+                cmd_run "ip-route" "ip route add table ${RTABLE} ${ROUTE}" "-nolog"
+            fi
+        fi
     done
     
     cmd_run "ip-route" "ip route add default dev ${IFACE_TUN} table ${RTABLE}"