[OpenWrt-Devel] [PATCH] [base-files] dhcp.script - only call firewall, if installed

Bastian Bittorf bittorf at bluebottle.com
Thu Oct 23 05:33:39 EDT 2014


base-files: dhcp.script: - only call firewall, if installed

we dont use fw3, so i was wondering about error-messages in syslog
about fw3. check if 'fw3' is in place, before calling it.

Signed-off-by: Bastian Bittorf <bittorf at bluebottle.com>
---
 package/network/config/netifd/files/lib/netifd/dhcp.script |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/package/network/config/netifd/files/lib/netifd/dhcp.script b/package/network/config/netifd/files/lib/netifd/dhcp.script
index 90fa6d3..2030fd5 100755
--- a/package/network/config/netifd/files/lib/netifd/dhcp.script
+++ b/package/network/config/netifd/files/lib/netifd/dhcp.script
@@ -50,7 +50,10 @@ setup_interface () {
 		ip6rd="${ip6rd#* }"
 		local ip6rdbr="${ip6rd%% *}"
 
-		[ -n "$ZONE" ] || ZONE=$(fw3 -q network $INTERFACE)
+		[ -z "$ZONE" ] && {
+			[ -e '/sbin/fw3' ] && ZONE=$(fw3 -q network $INTERFACE)
+		}
+
 		[ -z "$IFACE6RD" -o "$IFACE6RD" = 1 ] && IFACE6RD=${INTERFACE}_6rd
 
 		json_init
-- 
1.7.10.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list