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

Fixes for test speed scripts

This commit is contained in:
Ycarus (Yannick Chabanois) 2023-08-08 21:55:28 +02:00
parent d889f6f629
commit 6cbb420ffa
3 changed files with 30 additions and 16 deletions

View file

@ -43,7 +43,7 @@ trap : HUP INT TERM
if [ -z "$INTERFACE" ]; then
curl -4 -o /dev/null $HOST || echo
else
: /etc/init.d/sqm stop $INTERFACE
/etc/init.d/sqm stop $INTERFACE
domain=$(echo $HOST | awk -F/ '{print $3}')
hostip=$(dig +nocmd +noall +answer A $domain | grep -v CNAME | awk '{print $5}' | tr '\n' ' ')
if [ -n "$(ipset list 2>/dev/null | grep ss_rules)" ]; then
@ -62,5 +62,5 @@ else
ipset del ss_rules_dst_bypass_all $ip
done
fi
: /etc/init.d/sqm start $INTERFACE
/etc/init.d/sqm start $INTERFACE
fi

View file

@ -13,7 +13,14 @@ MP=false
if [ -n "$KEY" ] && [ -n "$HOST" ] && [ -n "$PORT" ]; then
trap : HUP INT TERM
[ -z "$FASTTEST" ] && echo "Disable SQM bandwidth limit on $INTERFACE"
: /etc/init.d/sqm stop $INTERFACE 2>&1 >/dev/null
[ -n "$(tc qdisc | grep $INTERFACE | grep bandwidth)" ] && {
export SQM_VERBOSITY_MIN=10
export SQM_VERBOSITY_MAX=0
export SQM_SYSLOG=1
/etc/init.d/sqm stop $INTERFACE 2>&1 >/dev/null
#tc qdisc delete dev $INTERFACE root 2>&1 >/dev/null
#tc qdisc delete dev ifb4$INTERFACE root 2>&1 >/dev/null
}
[ -z "$FASTTEST" ] && echo "Download test via server ${SERVER}:"
if [ -n "$INTERFACE" ]; then
#if [ "$(multipath ${INTERFACE} | grep default)" ]; then
@ -44,5 +51,5 @@ if [ -n "$KEY" ] && [ -n "$HOST" ] && [ -n "$PORT" ]; then
curl -k -o /dev/null -H "Authorization: Bearer ${KEY}" https://${HOST}:${PORT}/speedtest || echo
fi
[ -z "$FASTTEST" ] && echo "Restart SQM on $INTERFACE"
: /etc/init.d/sqm start $INTERFACE 2>&1 >/dev/null
/etc/init.d/sqm start $INTERFACE 2>&1 >/dev/null
fi