From 8ed70658e20f3c94ba125ebe6c832c5834cb2810 Mon Sep 17 00:00:00 2001 From: sofair Date: Tue, 10 Mar 2020 19:13:23 +0800 Subject: [PATCH] Update zerotier.stop (#3670) zerotier handle multiple zt interfaces. --- package/lean/luci-app-zerotier/root/etc/zerotier.stop | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package/lean/luci-app-zerotier/root/etc/zerotier.stop b/package/lean/luci-app-zerotier/root/etc/zerotier.stop index 68f3b718a..d464f9639 100755 --- a/package/lean/luci-app-zerotier/root/etc/zerotier.stop +++ b/package/lean/luci-app-zerotier/root/etc/zerotier.stop @@ -1,6 +1,8 @@ #!/bin/sh -zt0=$(ifconfig | grep zt | awk '{print $1}') +zts=$(ifconfig | grep zt | awk '{print $1}') +for zt0 in $zts +do if [ "$zt0" = "" ]; then zt0=$(cat /tmp/cat /tmp/zt.nif) fi @@ -10,3 +12,4 @@ iptables -D FORWARD -o $zt0 -j ACCEPT 2>/dev/null iptables -t nat -D POSTROUTING -o $zt0 -j MASQUERADE 2>/dev/null ip_segment=$(ip route | grep "dev $zt0 proto" | awk '{print $1}') iptables -t nat -D POSTROUTING -s $ip_segment -j MASQUERADE 2>/dev/null +done