Add ipfw_status command to etc/rc.d/ipfw
This is helpful when using service/conf management tools. Sonsored-By: Gandi.net
This commit is contained in:
parent
b0e1660d53
commit
600a08a80d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=320943
@ -17,7 +17,9 @@ start_cmd="ipfw_start"
|
||||
start_precmd="ipfw_prestart"
|
||||
start_postcmd="ipfw_poststart"
|
||||
stop_cmd="ipfw_stop"
|
||||
status_cmd="ipfw_status"
|
||||
required_modules="ipfw"
|
||||
extra_commands="status"
|
||||
|
||||
set_rcvar_obsolete ipv6_firewall_enable
|
||||
|
||||
@ -109,6 +111,18 @@ ipfw_stop()
|
||||
done
|
||||
}
|
||||
|
||||
ipfw_status()
|
||||
{
|
||||
status=$(sysctl -n net.inet.ip.fw.enable)
|
||||
if [ ${status} -eq 0 ]; then
|
||||
echo "ipfw is not enabled"
|
||||
exit 1
|
||||
else
|
||||
echo "ipfw is enabled"
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
|
||||
load_rc_config $name
|
||||
firewall_coscripts="/etc/rc.d/natd ${firewall_coscripts}"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user