Skip to content

Commit a437d1c

Browse files
authored
Reapply SQM on configuration reload
1 parent df57cc2 commit a437d1c

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

routertools

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2363,6 +2363,7 @@ daemon_inet(){
23632363
if ps -p $(cat /dev/shm/routertools_pid_$daemon_type) > /dev/null 2>&1; then
23642364
crit_error "There is an instance of this daemon already running."
23652365
fi
2366+
export current_iface="$inet_iface"
23662367
ledctl rmlock 2 &>/dev/null
23672368
ledctl blink &>/dev/null
23682369
export daemon_pid=$BASHPID
@@ -2423,7 +2424,8 @@ daemon_wifi(){
24232424
if ps -p $(cat /dev/shm/routertools_pid_$1) > /dev/null 2>&1; then
24242425
crit_error "There is an instance of this daemon already running."
24252426
fi
2426-
2427+
2428+
export current_iface="$1"
24272429
load_prefs_iface "$1"
24282430
ledctl rmlock 1 &>/dev/null
24292431
ledctl blink &>/dev/null
@@ -2538,7 +2540,13 @@ stop_daemon_wifi(){
25382540
daemon_sighup(){
25392541
echo "Recieved SIGHUP, reloading configuration."
25402542
load_prefs
2541-
load_prefs_iface "$1"
2543+
[[ "$daemon_type" != "inet" ]] && load_prefs_iface "$current_iface"
2544+
2545+
# Reapply SQM
2546+
if [[ "$daemon_type" == "inet" ]]; then
2547+
sqm_disable
2548+
[[ "$enable_cake_sqm" == "true" ]] && sqm_enable
2549+
fi
25422550
}
25432551

25442552
list_daemons(){
@@ -2569,6 +2577,8 @@ reload_all_daemons(){
25692577
if ps -p $daemon_pid > /dev/null 2>&1; then
25702578
kill -SIGHUP $daemon_pid 2>/dev/null
25712579
echo "Sent reload configuration request to daemon: $daemon_type"
2580+
# Avoid doing everything at the exact same time
2581+
sleep .1
25722582
else
25732583
rm $i 2>/dev/null
25742584
fi

0 commit comments

Comments
 (0)