Browse Source

Added nat-start script to re-establish routing when some changes to the NAT routing, e.g WAN port forwarding

Joachim M. Giæver 5 years ago
parent
commit
65689dbe4c
1 changed files with 13 additions and 0 deletions
  1. 13 0
      nat-start

+ 13 - 0
nat-start

@@ -0,0 +1,13 @@
+#!/bin/sh
+CONFIG=1
+source /usr/sbin/helper.sh
+
+TUN="tun"
+
+for IFACE in $(ls /sys/class/net); do
+	if [ "${IFACE:0:${#TUN}}" == "${TUN}" ]; then
+		logger "Re-establish routing for ${IFACE}"
+		/jffs/scripts/openvpn-event "${IFACE}" "" "" "" "" init
+		/jffs/scripts/openvpn-event "${IFACE}" "" "" "" ""
+	fi
+done