From: Jo-Philipp Wich Date: Tue, 31 May 2022 07:36:20 +0000 (+0200) Subject: fw4: make `fw4 restart` behavior more robust X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=4e5e3226260a7a67dce325314d0926745727bab0;p=project%2Ffirewall4.git 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 --- 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)