From 4e5e3226260a7a67dce325314d0926745727bab0 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 31 May 2022 09:36:20 +0200 Subject: [PATCH] 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 --- root/sbin/fw4 | 6 +++--- 1 file 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) -- 2.30.2