[package] firewall: use uci_get_state() wrapper
[openwrt.git] / package / firewall / files / firewall.hotplug
index e9d167b..bc75e42 100644 (file)
@@ -9,11 +9,20 @@
 
 . /lib/firewall/core.sh
 fw_init
-fw_is_loaded || exit 0
+
+# Wait for firewall if startup is in progress
+lock -w /var/lock/firewall.start
 
 case "$ACTION" in
        ifup)
-               fw_configure_interface "$INTERFACE" add "$DEVICE" ;;
+               fw_is_loaded && {
+                       fw_configure_interface "$INTERFACE" add "$DEVICE" &
+               } || {
+                       /etc/init.d/firewall enabled && fw_start &
+               }
+       ;;
        ifdown)
-               fw_configure_interface "$INTERFACE" del "$DEVICE" ;;
+               fw_is_loaded && fw_configure_interface "$INTERFACE" del "$DEVICE" &
+       ;;
 esac
+
This page took 0.025201 seconds and 4 git commands to generate.