Browse Source

Fix variables in calling stop-sqm.

Just sourcing the state file didn't actually pass the variables on to
the stop-sqm script. So explicitly pass on $IFACE and $SCRIPT.

Closes #10 (again; hopefully!).

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
Toke Høiland-Jørgensen 8 years ago
parent
commit
de551af17e
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/run-openwrt.sh

+ 3 - 3
src/run-openwrt.sh

@@ -19,9 +19,9 @@ RUN_IFACE="$2"
 # Stopping all active interfaces
 if [ "$ACTION" = "stop" -a -z "$RUN_IFACE" ]; then
     for f in ${SQM_STATE_DIR}/*.state; do
-        # Source the state file prior to stopping; we need some of the variables
-        # saved in there, most notably $IFACE and $SCRIPT.
-        [ -f "$f" ] && ( . $f; ${SQM_LIB_DIR}/stop-sqm )
+        # Source the state file prior to stopping; we need the $IFACE and
+        # $SCRIPT variables saved in there.
+        [ -f "$f" ] && ( . $f; IFACE=$IFACE SCRIPT=$SCRIPT ${SQM_LIB_DIR}/stop-sqm )
     done
     exit 0
 fi