mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Fix omr test speed v6
This commit is contained in:
parent
bbc373d157
commit
f6cfd19828
1 changed files with 13 additions and 9 deletions
|
@ -3,14 +3,14 @@
|
||||||
INTERFACE="$1"
|
INTERFACE="$1"
|
||||||
|
|
||||||
echo "Select best test server..."
|
echo "Select best test server..."
|
||||||
HOSTLST="http://speedtest.frankfurt.linode.com/garbage.php?ckSize=10000 http://speedtest.tokyo2.linode.com/garbage.php?ckSize=10000 http://speedtest.singapore.linode.com/garbage.php?ckSize=10000 http://speedtest.newark.linode.com/garbage.php?ckSize=10000 http://speedtest.atlanta.linode.com/garbage.php?ckSize=10000 http://speedtest.dallas.linode.com/garbage.php?ckSize=10000 http://speedtest.fremont.linode.com/garbage.php?ckSize=10000 http://speedtest.tele2.net/1000GB.zip http://www.ovh.net/files/10Gb.dat https://speed.hetzner.de/10GB.bin http://ipv4.bouygues.testdebit.info/10G.iso http://par.download.datapacket.com/10000mb.bin http://nyc.download.datapacket.com/10000mb.bin http://ams.download.datapacket.com/10000mb.bin http://fra.download.datapacket.com/10000mb.bin http://lon.download.datapacket.com/10000mb.bin http://mad.download.datapacket.com/10000mb.bin http://prg.download.datapacket.com/10000mb.bin http://sto.download.datapacket.com/10000mb.bin http://vie.download.datapacket.com/10000mb.bin http://war.download.datapacket.com/10000mb.bin http://atl.download.datapacket.com/10000mb.bin http://chi.download.datapacket.com/10000mb.bin http://lax.download.datapacket.com/10000mb.bin http://mia.download.datapacket.com/10000mb.bin http://nyc.download.datapacket.com/10000mb.bin"
|
HOSTLST="http://speedtest.frankfurt.linode.com/garbage.php?ckSize=10000 http://speedtest.tokyo2.linode.com/garbage.php?ckSize=10000 http://speedtest.singapore.linode.com/garbage.php?ckSize=10000 http://speedtest.newark.linode.com/garbage.php?ckSize=10000 http://speedtest.atlanta.linode.com/garbage.php?ckSize=10000 http://speedtest.dallas.linode.com/garbage.php?ckSize=10000 http://speedtest.fremont.linode.com/garbage.php?ckSize=10000 http://speedtest.tele2.net/1000GB.zip http://www.ovh.net/files/10Gb.dat https://speed.hetzner.de/10GB.bin http://ipv6.bouygues.testdebit.info/10G.iso http://par.download.datapacket.com/10000mb.bin http://nyc.download.datapacket.com/10000mb.bin http://ams.download.datapacket.com/10000mb.bin http://fra.download.datapacket.com/10000mb.bin http://lon.download.datapacket.com/10000mb.bin http://mad.download.datapacket.com/10000mb.bin http://prg.download.datapacket.com/10000mb.bin http://sto.download.datapacket.com/10000mb.bin http://vie.download.datapacket.com/10000mb.bin http://war.download.datapacket.com/10000mb.bin http://atl.download.datapacket.com/10000mb.bin http://chi.download.datapacket.com/10000mb.bin http://lax.download.datapacket.com/10000mb.bin http://mia.download.datapacket.com/10000mb.bin http://nyc.download.datapacket.com/10000mb.bin"
|
||||||
bestping="999"
|
bestping="999"
|
||||||
for pinghost in $HOSTLST; do
|
for pinghost in $HOSTLST; do
|
||||||
domain=$(echo $pinghost | awk -F/ '{print $3}')
|
domain=$(echo $pinghost | awk -F/ '{print $3}')
|
||||||
if [ -z "$INTERFACE" ]; then
|
if [ -z "$INTERFACE" ]; then
|
||||||
ping=$(ping -c1 -w2 $domain | cut -d "/" -s -f5 | cut -d "." -f1)
|
ping=$(ping -6 -c1 -w2 $domain | cut -d "/" -s -f5 | cut -d "." -f1)
|
||||||
else
|
else
|
||||||
ping=$(ping -c1 -w2 -I $INTERFACE -B $domain | cut -d "/" -s -f5 | cut -d "." -f1)
|
ping=$(ping -6 -c1 -w2 -I $INTERFACE -B $domain | cut -d "/" -s -f5 | cut -d "." -f1)
|
||||||
fi
|
fi
|
||||||
echo "host: $domain - ping: $ping"
|
echo "host: $domain - ping: $ping"
|
||||||
if [ -n "$ping" ] && [ "$ping" -lt "$bestping" ]; then
|
if [ -n "$ping" ] && [ "$ping" -lt "$bestping" ]; then
|
||||||
|
@ -28,11 +28,15 @@ if [ -z "$INTERFACE" ]; then
|
||||||
else
|
else
|
||||||
domain=$(echo $HOST | awk -F/ '{print $3}')
|
domain=$(echo $HOST | awk -F/ '{print $3}')
|
||||||
hostip=$(dig +nocmd +noall +answer AAAA $domain | grep -v CNAME | awk '{print $5}' | tr '\n' ' ')
|
hostip=$(dig +nocmd +noall +answer AAAA $domain | grep -v CNAME | awk '{print $5}' | tr '\n' ' ')
|
||||||
|
if [ -n "$(ipset list 2>/dev/null | grep ss_rules6)" ]; then
|
||||||
for ip in $hostip; do
|
for ip in $hostip; do
|
||||||
ipset add ss_rules6_dst_bypass_all $ip
|
ipset add ss_rules6_dst_bypass_all $ip
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
curl -6 --interface $INTERFACE $HOST >/dev/null || echo
|
curl -6 --interface $INTERFACE $HOST >/dev/null || echo
|
||||||
|
if [ -n "$(ipset list 2>/dev/null | grep ss_rules6)" ]; then
|
||||||
for ip in $hostip; do
|
for ip in $hostip; do
|
||||||
ipset del ss_rules6_dst_bypass_all $ip
|
ipset del ss_rules6_dst_bypass_all $ip
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue