mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Fix on omr-test-speed for fasttest
This commit is contained in:
parent
63d19c4861
commit
7139a5db51
2 changed files with 9 additions and 3 deletions
|
@ -13,9 +13,10 @@ if [ "$1" = "fasttest" ]; then
|
|||
fi
|
||||
for i in $@; do :; done
|
||||
INTERFACE="$i"
|
||||
[ "$INTERFACE" = "forcevps" ] || [ "$INTERFACE" = "fasttest" ] && INTERFACE=""
|
||||
|
||||
[ -n "$INTERFACE" ] && [ ! -d "/sys/class/net/$INTERFACE" ] && {
|
||||
echo "You must use a real interface. You wan find them using 'ip a' for example"
|
||||
echo "You must use a real interface. You wan find them using 'ip a' for example (not $INTERFACE)"
|
||||
exit 0
|
||||
}
|
||||
|
||||
|
@ -41,7 +42,12 @@ done
|
|||
[ "$FASTTEST" = true ] || echo "Best server is $HOST, running test:"
|
||||
trap : HUP INT TERM
|
||||
if [ -z "$INTERFACE" ]; then
|
||||
curl -4 -o /dev/null $HOST || echo
|
||||
if [ "$FASTTEST" = true ]; then
|
||||
avg_speed=$(curl -4 --max-time 10 -o /dev/null -qfsS -w '%{speed_download}' $HOST 2>/dev/null)
|
||||
echo "$avg_speed"
|
||||
else
|
||||
curl -4 -o /dev/null $HOST || echo
|
||||
fi
|
||||
else
|
||||
[ -n "$(tc qdisc show dev $INTERFACE | grep ingress)" ] && /etc/init.d/sqm stop $INTERFACE
|
||||
domain=$(echo $HOST | awk -F/ '{print $3}')
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#!/bin/sh
|
||||
#!/bin/sh
|
||||
# (c) Yannick Chabanois (ycarus@zugaina.org) for OpenMPTCProuter
|
||||
#
|
||||
#
|
||||
|
@ -14,6 +13,7 @@ if [ "$1" = "fasttest" ]; then
|
|||
fi
|
||||
for i in $@; do :; done
|
||||
INTERFACE="$i"
|
||||
[ "$INTERFACE" = "forcevps" ] || [ "$INTERFACE" = "fasttest" ] && INTERFACE=""
|
||||
|
||||
[ -n "$INTERFACE" ] && [ ! -d "/sys/class/net/$INTERFACE" ] && {
|
||||
echo "You must use a real interface. You wan find them using 'ip a' for example"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue