Add 'show macro' command

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2010-01-12 13:12:01 -08:00
parent d164880381
commit 6c62f14749
2 changed files with 13 additions and 0 deletions

View File

@ -641,6 +641,18 @@ show_command() {
grep -Ev '^\#|^$' ${SHAREDIR}/actions.std
fi
return
;;
macro)
[ $# -ne 2 ] && usage 1
for directory in $(split $CONFIG_PATH); do
if [ -f ${directory}/macro.$2 ]; then
echo "Shorewall $version Macro $2 at $HOSTNAME - $(date)"
cat ${directory}/macro.$2
return
fi
done
echo " WARNING: Macro $2 not found" >&2
return
;;
macros)

View File

@ -1387,6 +1387,7 @@ usage() # $1 = exit status
echo " show filters"
echo " show ip"
echo " show [ -m ] log"
echo " show macro <macro>"
echo " show macros"
echo " show [ -x ] mangle|nat|raw|routing"
echo " show policies"