Differences between current version and predecessor to the previous major change of KnowledgeBase/FreeBSD/pfScripts/pflist.
Other diffs: Previous Revision, Previous Author
Newer page: | version 2 | Last edited on Sunday, 10 January 2010 13:18:24 | by CyberLeo | |
Older page: | version 1 | Last edited on Tuesday, 26 August 2008 1:17:54 | by CyberLeo | Revert |
@@ -1,5 +1,5 @@
-<verbatim
>
+<code brush=bash
>
#!/bin/sh
display=""
@@ -77,5 +77,5 @@
echo "==> ${table}"
pfctl -t ${table} -T show
echo ""
done
-</verbatim
>
+</code
>
current version
#!/bin/sh display="" rules="" nat="" tables="" while [ -n "${1}" ] do case "${1}" in r*) rules="YES" ;; n*) nat="YES" ;; t*) tables="YES" ;; a*) rules="YES" nat="YES" tables="YES" ;; *) # meow ;; esac shift done if [ -n "${rules}" -o -n "${nat}" ] then echo -n "=> " [ -n "${nat}" ] && echo -n "NAT" [ -n "${nat}" -a -n "${rules}" ] && echo -n "/" [ -n "${rules}" ] && echo -n "Rules" echo " <=" for anchor in $(pfctl -vvsAnchor) do echo "==> ${anchor}" [ -n "${nat}" ] && pfctl -a ${anchor} -s nat [ -n "${rules}" ] && pfctl -a ${anchor} -s rules echo "" done fi if [ -n "${tables}" ] then echo "=> Tables <=" for table in $(pfctl -sTable) do echo "==> ${table}" pfctl -t ${table} -T show echo "" done fi exit 0 echo "=> NAT/Rules <=" for anchor in $(pfctl -vvsAnchor) do echo "==> ${anchor}" pfctl -a${anchor} -snat pfctl -a${anchor} -srules echo "" done echo "" echo "=> Tables <=" for table in $(pfctl -sTable) do echo "==> ${table}" pfctl -t ${table} -T show echo "" done