summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authormtm <mtm@FreeBSD.org>2003-03-30 15:52:18 +0000
committermtm <mtm@FreeBSD.org>2003-03-30 15:52:18 +0000
commitc5a4cda5044b6f3068c26b1ff82d11c38646d366 (patch)
tree48067c5872739317e72115399e6d4572954fbf85 /etc
parentbb8188c89538d3d7a82ea0438d714333d9d1f38e (diff)
downloadFreeBSD-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)
Diffstat (limited to 'etc')
-rw-r--r--etc/rc.d/ipfw19
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
OpenPOWER on IntegriCloud