Update zerotier.stop (#3670)

zerotier handle multiple zt interfaces.
This commit is contained in:
sofair 2020-03-10 19:13:23 +08:00 committed by GitHub
parent 2db4ae81cd
commit 8ed70658e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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