summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndris PE2024-09-02 15:38:59 +0000
committerJo-Philipp Wich2025-03-17 15:44:40 +0000
commit00fc6943a29732375addf72a12f2381df5b25428 (patch)
treeeb910481d8ccbefa1d4bc4404d18d98084f5d1ac
parentad3cba79c19209beaff61279338b1146b343cdc1 (diff)
init: remove unnecessary stop logic
Always remove table and service state to have consistent cleaned up system state on exit even if user intentionally dropped our table. Removes dependency on grep as a consequence. Ref: https://wiki.nftables.org/wiki-nftables/index.php/Configuring_tables Supersedes: https://github.com/openwrt/firewall4/pull/33 Signed-off-by: Andris PE <neandris@gmail.com>
-rwxr-xr-xroot/sbin/fw49
1 files changed, 3 insertions, 6 deletions
diff --git a/root/sbin/fw4 b/root/sbin/fw4
index c3e95c2..d9ac8a1 100755
--- a/root/sbin/fw4
+++ b/root/sbin/fw4
@@ -49,12 +49,9 @@ stop() {
{
flock -x 1000
- if nft list tables inet | grep -sq "table inet fw4"; then
- nft delete table inet fw4
- rm -f $STATE
- else
- return 1
- fi
+ nft delete table inet fw4
+ rm -f $STATE
+
} 1000>$LOCK
}