Allow display of multiple chains in 'shorewall show'

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@716 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2003-08-15 00:59:06 +00:00
parent 52f6ce84ad
commit b32b250743
3 changed files with 18 additions and 8 deletions

View File

@ -195,8 +195,8 @@ save)
;;
show)
echo "show: show [<chain>|classifiers|connections|log|nat|tc|tos]
shorewall show chain - produce a verbose report about the IPtable chains.
echo "show: show [<chain> [ <chain> ...] |classifiers|connections|log|nat|tc|tos]
shorewall show <chain> [ <chain> ... ] - produce a verbose report about the IPtable chain(s).
(iptables -L chain -n -v)
shorewall show nat - produce a verbose report about the nat table.

View File

@ -293,5 +293,6 @@ New Features:
zones individually rather than as a single limit for all pairs of
zones covered by the rule.
10) Multiple chains may now be displayed in one "shorewall show"
command (e.g., shorewall show INPUT FORWARD OUTOUT).

View File

@ -51,7 +51,7 @@
# compensate for a change of
# broadcast address on any "detect"
# interface.
# shorewall show <chain> Display the rules in a <chain>
# shorewall show <chain> [ <chain> ... ] Display the rules in each <chain> listed
# shorewall show log Print the last 20 log messages
# shorewall show connections Show the kernel's connection
# tracking table
@ -590,7 +590,7 @@ usage() # $1 = exit status
echo " reset"
echo " restart"
echo " save"
echo " show [<chain>|classifiers|connections|log|nat|tc|tos]"
echo " show [<chain> [ <chain> ... ]|classifiers|connections|log|nat|tc|tos]"
echo " start"
echo " stop"
echo " status"
@ -738,26 +738,29 @@ case "$1" in
exec $SHOREWALL_SHELL $FIREWALL $debugging $nolock $1 $2 $3
;;
show|list)
[ $# -gt 2 ] && usage 1
case "$2" in
connections)
[ $# -gt 2 ] && usage 1
echo "Shorewall-$version Connections at $HOSTNAME - `date`"
echo
cat /proc/net/ip_conntrack
;;
nat)
[ $# -gt 2 ] && usage 1
echo "Shorewall-$version NAT at $HOSTNAME - `date`"
echo
show_reset
iptables -t nat -L -n -v
;;
tos|mangle)
[ $# -gt 2 ] && usage 1
echo "Shorewall-$version TOS at $HOSTNAME - `date`"
echo
show_reset
iptables -t mangle -L -n -v
;;
log)
[ $# -gt 2 ] && usage 1
get_config
echo "Shorewall-$version Log at $HOSTNAME - `date`"
echo
@ -766,20 +769,26 @@ case "$1" in
packet_log 20
;;
tc)
[ $# -gt 2 ] && usage 1
echo "Shorewall-$version Traffic Control at $HOSTNAME - `date`"
echo
show_tc
;;
classifiers)
[ $# -gt 2 ] && usage 1
echo "Shorewall-$version Clasifiers at $HOSTNAME - `date`"
echo
show_classifiers
;;
*)
echo "Shorewall-$version Chain $2 at $HOSTNAME - `date`"
shift
echo "Shorewall-$version `[ $# -gt 1 ] && echo Chains || echo Chain` $* at $HOSTNAME - `date`"
echo
show_reset
iptables -L $2 -n -v
for chain in $*; do
iptables -L $chain -n -v
done
;;
esac
;;