diff options
-rw-r--r-- | etc/rc.d/ipfw | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/etc/rc.d/ipfw b/etc/rc.d/ipfw index db4a2ec..531063f 100644 --- a/etc/rc.d/ipfw +++ b/etc/rc.d/ipfw @@ -14,7 +14,7 @@ name="ipfw" rcvar="firewall_enable" start_cmd="ipfw_start" start_precmd="ipfw_precmd" -stop_cmd="${SYSCTL_W} net.inet.ip.fw.enable=0" +stop_cmd="ipfw_stop" ipfw_precmd() { @@ -60,10 +60,21 @@ ipfw_start() # Firewall logging # - ! checkyesno firewall_logging && return 0 + if checkyesno firewall_logging; then + echo 'Firewall logging enabled' + sysctl net.inet.ip.fw.verbose=1 >/dev/null + fi + + # Enable the firewall + # + ${SYSCTL_W} net.inet.ip.fw.enable=1 +} - echo 'Firewall logging=YES' - sysctl net.inet.ip.fw.verbose=1 >/dev/null +ipfw_stop() +{ + # Disable the firewall + # + ${SYSCTL_W} net.inet.ip.fw.enable=0 } load_rc_config $name |