From 4c6076088aa19703494353d3c6e234ad089986c4 Mon Sep 17 00:00:00 2001 From: Eugene Grosbein Date: Tue, 21 Jan 2020 17:16:02 +0000 Subject: [PATCH] libexec/rc/rc.d/ipfw: style fix after r356943 Also, make sure it does not break for systems without ipfw code loaded. MFC after: 1 months X-MFC-with: 356943 --- libexec/rc/rc.d/ipfw | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libexec/rc/rc.d/ipfw b/libexec/rc/rc.d/ipfw index ef8ce796b41..df14b7eaa0d 100755 --- a/libexec/rc/rc.d/ipfw +++ b/libexec/rc/rc.d/ipfw @@ -127,10 +127,11 @@ ipfw_stop() ipfw_status() { status=$(sysctl -i -n net.inet.ip.fw.enable) + : ${status:=0} if afexists inet6; then - status=$(( $status + $(sysctl -i -n net.inet6.ip6.fw.enable) )) + status=$((${status} + $(sysctl -i -n net.inet6.ip6.fw.enable))) fi - if [ ${status:-0} -eq 0 ]; then + if [ ${status} -eq 0 ]; then echo "ipfw is not enabled" exit 1 else