Merge pull request #12 from openwrt-routing/nds-optional-imq
authorMoritz Warning <moritzwarning@web.de>
Mon, 16 Dec 2013 20:53:00 +0000 (12:53 -0800)
committerMoritz Warning <moritzwarning@web.de>
Mon, 16 Dec 2013 20:53:00 +0000 (12:53 -0800)
nodogsplash: check if TrafficControl is enabled before testing imq module requirement.

nodogsplash/Makefile
nodogsplash/files/nodogsplash.init

index a599823203a6845fd5718820677b1807742de073..dd2b1e415abbc6db8b2ae4249326dbb840507432 100644 (file)
@@ -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
index 7eba60b1661ba1c8281f049f6e0c0637a4fd3956..b4657923181b810abefceb45b887a41b148e8960 100644 (file)
@@ -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 -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"
+    fi
 }