From 6c62f14749c9c034c595ae83c4a25ee9d0c195a3 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Tue, 12 Jan 2010 13:12:01 -0800 Subject: [PATCH] Add 'show macro' command Signed-off-by: Tom Eastep --- Shorewall/lib.cli | 12 ++++++++++++ Shorewall/shorewall | 1 + 2 files changed, 13 insertions(+) diff --git a/Shorewall/lib.cli b/Shorewall/lib.cli index 796c70744..f1951b66a 100644 --- a/Shorewall/lib.cli +++ b/Shorewall/lib.cli @@ -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) diff --git a/Shorewall/shorewall b/Shorewall/shorewall index daefe0684..4badd2a6d 100755 --- a/Shorewall/shorewall +++ b/Shorewall/shorewall @@ -1387,6 +1387,7 @@ usage() # $1 = exit status echo " show filters" echo " show ip" echo " show [ -m ] log" + echo " show macro " echo " show macros" echo " show [ -x ] mangle|nat|raw|routing" echo " show policies"