diff options
author | mtm <mtm@FreeBSD.org> | 2003-03-30 15:52:18 +0000 |
---|---|---|
committer | mtm <mtm@FreeBSD.org> | 2003-03-30 15:52:18 +0000 |
commit | c5a4cda5044b6f3068c26b1ff82d11c38646d366 (patch) | |
tree | 48067c5872739317e72115399e6d4572954fbf85 | |
parent | bb8188c89538d3d7a82ea0438d714333d9d1f38e (diff) | |
download | FreeBSD-src-c5a4cda5044b6f3068c26b1ff82d11c38646d366.zip FreeBSD-src-c5a4cda5044b6f3068c26b1ff82d11c38646d366.tar.gz |
Make the 'restart' command work. Otherwise, it would successfully
stop ipfw, but not enable it again.
Aesthetic changes
o Use positve logic (instead of negative)
o create a 'stop' function, rather than putting the
commands in the stop_cmd variable.
Submitted by: des
Approved by: markm (mentor) (implicit)
-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 |