summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJo-Philipp Wich2022-05-31 07:36:20 +0000
committerJo-Philipp Wich2022-05-31 07:36:20 +0000
commit4e5e3226260a7a67dce325314d0926745727bab0 (patch)
tree52259076aa953f3ed6d5c9b53d8bbb2cc991a2f2
parent221040ee1c197fde7460bf16723058e0d09d707a (diff)
downloadfirewall4-4e5e3226260a7a67dce325314d0926745727bab0.tar.gz
fw4: make `fw4 restart` behavior more robust
Start the firewall on `fw4 restart` even if it was not previously started. Ref: #9935 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rwxr-xr-xroot/sbin/fw46
1 files changed, 3 insertions, 3 deletions
diff --git a/root/sbin/fw4 b/root/sbin/fw4
index 30db129..b66f5d7 100755
--- a/root/sbin/fw4
+++ b/root/sbin/fw4
@@ -48,7 +48,7 @@ stop() {
nft delete table inet fw4
rm -f $STATE
else
- die "The fw4 firewall does not appear to be loaded, try fw4 flush to delete all rules."
+ return 1
fi
} 1000>$LOCK
}
@@ -97,13 +97,13 @@ case "$1" in
start "$1"
;;
stop)
- stop
+ stop || die "The fw4 firewall does not appear to be loaded, try fw4 flush to delete all rules."
;;
flush)
flush
;;
restart)
- stop
+ stop || rm -f $STATE
start
;;
print)