From 4bcf0bc5a85fa072d0c79c7e8355e9448d59aff4 Mon Sep 17 00:00:00 2001 From: Gui Iribarren Date: Sun, 15 Dec 2013 08:31:50 -0300 Subject: [PATCH 1/2] nodogsplash: check if TrafficControl is enabled before testing imq module requirement. This avoids failing to start in current OpenWrt Attitude Adjustment and trunk, which lack IMQ support (and WONTFIX). Suggested in the issue discussed in: http://ml.ninux.org/pipermail/nodogsplash/2013-May/000009.html Signed-off-by: Gui Iribarren --- nodogsplash/Makefile | 2 +- nodogsplash/files/nodogsplash.init | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/nodogsplash/Makefile b/nodogsplash/Makefile index a599823..dd2b1e4 100644 --- a/nodogsplash/Makefile +++ b/nodogsplash/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nodogsplash PKG_FIXUP:=autoreconf PKG_VERSION:=0.9_beta9.9.8 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz diff --git a/nodogsplash/files/nodogsplash.init b/nodogsplash/files/nodogsplash.init index 7eba60b..588e20e 100644 --- a/nodogsplash/files/nodogsplash.init +++ b/nodogsplash/files/nodogsplash.init @@ -13,6 +13,7 @@ IPT=/usr/sbin/iptables WD_DIR=/usr/bin +NDS_CONF=/etc/nodogsplash/nodogsplash.conf OPTIONS="" START=65 STOP=65 @@ -168,9 +169,11 @@ test_module() { do_module_tests "ipt_mac" do_module_tests "ipt_mark" - # if not using traffic control, - # you can comment out the following 3 lines: - do_module_tests "imq" "numdevs=2" - do_module_tests "ipt_IMQ" - do_module_tests "sch_htb" + + # test for imq modules, only if TrafficControl is enabled in conf + if ( grep -q '^[[:space:]]*TrafficControl[[:space:]]\+yes' "$NDS_CONF" ) ; then + do_module_tests "imq" "numdevs=2" + do_module_tests "ipt_IMQ" + do_module_tests "sch_htb" + fi } From 0c2656c4029a60f096198c87f60de7b18b004c50 Mon Sep 17 00:00:00 2001 From: Gui Iribarren Date: Sun, 15 Dec 2013 08:47:17 -0300 Subject: [PATCH 2/2] nodogsplash: recognize yes, true or 1 as valid TrafficControl values --- nodogsplash/files/nodogsplash.init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodogsplash/files/nodogsplash.init b/nodogsplash/files/nodogsplash.init index 588e20e..b465792 100644 --- a/nodogsplash/files/nodogsplash.init +++ b/nodogsplash/files/nodogsplash.init @@ -171,7 +171,7 @@ test_module() { do_module_tests "ipt_mark" # test for imq modules, only if TrafficControl is enabled in conf - if ( grep -q '^[[:space:]]*TrafficControl[[:space:]]\+yes' "$NDS_CONF" ) ; then + if ( grep -q -E '^[[:space:]]*TrafficControl[[:space:]]+(yes|true|1)' "$NDS_CONF" ) ; then do_module_tests "imq" "numdevs=2" do_module_tests "ipt_IMQ" do_module_tests "sch_htb"