1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-12 10:31:51 +00:00

Fix for SQM autorate

This commit is contained in:
Ycarus (Yannick Chabanois) 2023-07-18 09:14:34 +02:00
parent 00267a8e86
commit 75694cfc65
2 changed files with 4 additions and 4 deletions

View file

@ -8,7 +8,6 @@
# Inspiration taken from: @moeller0 (OpenWrt forum)
INTERFACE=$(basename "$1" | cut -d. -f2)
#cake_autorate_version="2.0.0"
# *** OUTPUT AND LOGGING OPTIONS ***
@ -77,9 +76,9 @@ reflector_ping_interval_s=$(uci -q get sqm.${INTERFACE}.reflector_ping_interval_
# delay threshold in ms is the extent of OWD increase to classify as a delay
# these are automatically adjusted based on maximum on the wire packet size
# (adjustment significant at sub 12Mbit/s rates, else negligible)
dl_delay_thr_ms=$(uci -q get sqm.${INTERFACE}.delay_thr_ms) || $(($(ping -B -w 5 -c 5 -I ${ul_if} 1.1.1.1 | cut -d '/' -s -f6 | cut -d '.' -f1 | tr -d '\n' 2>/dev/null)+30)) || echo 100 # (milliseconds)
#logger -t "sqm-autorate" "ping for ${INTERFACE} (${ul_if}): $(echo $(/sbin/uci -q get sqm.${INTERFACE}.delay_thr_ms || echo '100'))"
dl_delay_thr_ms=$(echo $(uci -q get sqm.${INTERFACE}.delay_thr_ms || echo $(($(/usr/bin/ping -B -w 5 -c 5 -I ${ul_if} 1.1.1.1 | cut -d '/' -s -f6 | cut -d '.' -f1 | tr -d '\n' 2>/dev/null)+30)) || echo "100")) # (milliseconds)
ul_delay_thr_ms=${dl_delay_thr_ms}
# Set either of the below to 0 to adjust one direction only
# or alternatively set both to 0 to simply use cake-autorate to monitor a connection
adjust_dl_shaper_rate=1 # enable (1) or disable (0) actually changing the dl shaper rate

View file

@ -1752,7 +1752,8 @@ if [ "$(pgrep -f openmptcprouter-vps)" = "" ] && ([ "$(uci -q show openmptcprout
sleep 5
fi
if [ "$(uci -q get sqm.${OMR_TRACKER_INTERFACE}.enabled)" = "1" ] && [ "$(uci -q get sqm.${OMR_TRACKER_INTERFACE}.autorate)" = "1" ] && [ -n "$OMR_TRACKER_DEVICE" ] && [ -z $(pgrep -f "autorate_config.${OMR_TRACKER_INTERFACE}") ]; then
if [ "$(uci -q get sqm.${OMR_TRACKER_INTERFACE}.enabled)" = "1" ] && [ "$(uci -q get sqm.${OMR_TRACKER_INTERFACE}.autorate)" = "1" ] && [ -n "$OMR_TRACKER_DEVICE" ] && [ -z $(pgrep -f "config.${OMR_TRACKER_INTERFACE}") ]; then
_log "Restart SQM Autorate"
/etc/init.d/sqm-autorate restart >/dev/null 2>&1
sleep 5
fi