summaryrefslogtreecommitdiffstats
path: root/package/firewall/files/lib
diff options
context:
space:
mode:
Diffstat (limited to 'package/firewall/files/lib')
-rw-r--r--package/firewall/files/lib/core.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/package/firewall/files/lib/core.sh b/package/firewall/files/lib/core.sh
index 3fd98d160..bf44231fb 100644
--- a/package/firewall/files/lib/core.sh
+++ b/package/firewall/files/lib/core.sh
@@ -8,6 +8,8 @@ include /lib/network
fw_start() {
fw_init
+ lock /var/lock/firewall.start
+
FW_DEFAULTS_APPLIED=
fw_is_loaded && {
@@ -49,6 +51,8 @@ fw_start() {
fw_callback post core
uci_set_state firewall core loaded 1
+
+ lock -u /var/lock/firewall.start
}
fw_stop() {
@@ -75,9 +79,8 @@ fw_reload() {
}
fw_is_loaded() {
- local bool
- config_get_bool bool core loaded 0
- return $((! $bool))
+ local bool=$(uci -q -P /var/state get firewall.core.loaded)
+ return $((! ${bool:-0}))
}