[PC-BSD Commits] r2015 - pcbsd/trunk/system-overlay/PCBSD/Scripts

svn at pcbsd.org svn at pcbsd.org
Tue Jun 3 09:08:13 PDT 2008


Author: kris
Date: 2008-06-03 09:08:13 -0700 (Tue, 03 Jun 2008)
New Revision: 2015

Modified:
   pcbsd/trunk/system-overlay/PCBSD/Scripts/reset-firewall
Log:

Added option to reset-firewall script, so you can reset a pf.conf file, and
provide extra ports to open as arguments



Modified: pcbsd/trunk/system-overlay/PCBSD/Scripts/reset-firewall
===================================================================
--- pcbsd/trunk/system-overlay/PCBSD/Scripts/reset-firewall	2008-06-03 15:46:44 UTC (rev 2014)
+++ pcbsd/trunk/system-overlay/PCBSD/Scripts/reset-firewall	2008-06-03 16:08:13 UTC (rev 2015)
@@ -7,6 +7,9 @@
 #
 # See COPYING for licence terms.
 
+# 06-03-2008 - Kris Moore (PC-BSD Software)
+# Added option to open specific ports by passing variables
+
 pf_rules="/etc/pf.conf"
 
 echo "Creating $pf_rules."
@@ -38,6 +41,16 @@
   echo "pass in on $inf proto tcp from any to ($inf) port 445 keep state" >> $pf_rules
   echo "pass in on $inf proto tcp from any to ($inf) port 137 keep state" >> $pf_rules
   echo "pass in on $inf proto tcp from any to ($inf) port 139 keep state" >> $pf_rules
+
+    # Check if there are any extra ports to open and do so
+    if [ ! -z "$@" ]
+    then
+       for port in "$@"
+       do
+         echo "pass in on $inf proto udp from any to ($inf) port ${port} keep state" >> $pf_rules
+         echo "pass in on $inf proto tcp from any to ($inf) port ${port} keep state" >> $pf_rules
+       done
+    fi
 			
   fi
 done



More information about the Commits mailing list