From 664fd7c69617987275264e6be95206ca068e2d46 Mon Sep 17 00:00:00 2001 From: Ycarus Date: Sun, 22 Jul 2018 22:10:30 +0200 Subject: [PATCH] Add interface parameter to omr-speed-test --- openmptcprouter/files/bin/omr-test-speed | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/openmptcprouter/files/bin/omr-test-speed b/openmptcprouter/files/bin/omr-test-speed index 87cc98544..cd22968cf 100755 --- a/openmptcprouter/files/bin/omr-test-speed +++ b/openmptcprouter/files/bin/omr-test-speed @@ -1,7 +1,20 @@ #!/bin/sh # vim: set noexpandtab tabstop=4 shiftwidth=4 softtabstop=4 : +INTERFACE="$1" HOST="proof.ovh.net" trap : HUP INT TERM -curl http://$HOST/files/10Gio.dat >/dev/null || echo +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 + 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 +fi