Fix the ipfw service status output when ipfw.ko isn't loaded

Reported by:	lme
Reviewed by:	lme
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D27657
This commit is contained in:
Mark Johnston 2020-12-18 16:02:28 +00:00
parent 50a6b28a31
commit 5120612664

View File

@ -129,7 +129,9 @@ 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)))
status6=$(sysctl -i -n net.inet6.ip6.fw.enable)
: ${status6:=0}
status=$((${status} + ${status6}))
fi
if [ ${status} -eq 0 ]; then
echo "ipfw is not enabled"