From e9b7f7e40e0fa225982ebe7c2d91c8bce6718ca4 Mon Sep 17 00:00:00 2001 From: Ycarus Date: Wed, 25 Jul 2018 10:49:02 +0200 Subject: [PATCH] Use ipset directly to bypass shadowsocks --- openmptcprouter/files/bin/omr-test-speed | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/openmptcprouter/files/bin/omr-test-speed b/openmptcprouter/files/bin/omr-test-speed index cd22968cf..68b1454cf 100755 --- a/openmptcprouter/files/bin/omr-test-speed +++ b/openmptcprouter/files/bin/omr-test-speed @@ -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