Browse Source

Teach run-openwrt.sh to export SQM_DEBUG if it was passed in

sqm-scripts now includes the machinery to redirect verbose debugging
output into a log file (SQM_DEBUG_LOG) if SQ_DEBUG was set to 1. This
commit allows to collect debugging out by e.g. calling:
/etc/init.d/sqm stop ; SQM_DEBUG=1 /etc/init.d/sqm start ; SQM_DEBUG=1 /etc/init.d/sqm stop
on the command line. run.sh on openwrt systems will now export SQM_DEBUG
if the variable exists in its environment; so that all called/sourced
sub scripts will have access to that variable.

Signed-off-by: Sebastian Moeller <moeller0@gmx.de>
Sebastian Moeller 8 years ago
parent
commit
41d459042d
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/run-openwrt.sh

+ 4 - 0
src/run-openwrt.sh

@@ -59,6 +59,10 @@ run_sqm_scripts() {
     export QDISC=$(config_get "$section" qdisc)
     export SCRIPT=$(config_get "$section" script)
 
+
+    #sm: if SQM_DEBUG was passed in via the command line make it available to the other scripts
+    [ -z "$SQM_DEBUG" ] && export SQM_DEBUG
+
     #sm: only stop-sqm if there is something running
     CUR_STATE_FILE="${SQM_STATE_DIR}/${IFACE}.state"
     if [ -f "${CUR_STATE_FILE}" ]; then