1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-15 03:51:51 +00:00

Use ipset directly to bypass shadowsocks

This commit is contained in:
Ycarus 2018-07-25 10:49:02 +02:00
parent a8c6be62ff
commit e9b7f7e40e

View file

@ -8,13 +8,8 @@ trap : HUP INT TERM
if [ -z "$INTERFACE" ]; then
curl http://$HOST/files/10Gio.dat >/dev/null || echo
else
uci -q batch <<-EOF >/dev/null
add_list dhcp.@dnsmasq[-1].ipset='/$HOST/ss_rules_dst_bypass'
commit dhcp
EOF
hostip=$(dig +short A $HOST | tr -d "\n")
ipset add ss_rules_dst_bypass $hostip
curl --interface $INTERFACE http://$HOST/files/10Gio.dat >/dev/null || echo
uci -q batch <<-EOF >/dev/null
del_list dhcp.@dnsmasq[-1].ipset='/$HOST/ss_rules_dst_bypass'
commit dhcp
EOF
ipset del ss_rules_dst_bypass $hostip
fi