From e29d6d080d966edd6b0ca7a503ff604e89b0449d Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Sat, 29 May 2010 08:59:45 -0700 Subject: [PATCH] Restore -a functionality to the version command Signed-off-by: Tom Eastep --- Shorewall/changelog.txt | 2 ++ Shorewall/releasenotes.txt | 3 +++ Shorewall/shorewall | 18 +++++++++++++++++- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Shorewall/changelog.txt b/Shorewall/changelog.txt index 88157e9a6..2c55755b1 100644 --- a/Shorewall/changelog.txt +++ b/Shorewall/changelog.txt @@ -8,6 +8,8 @@ Changes in Shorewall 4.4.10 4) Add SAFESTOP option to /etc/default/shorewall* +5) Restore -a functionality to the version command. + Changes in Shorewall 4.4.9 1) Auto-detection of bridges. diff --git a/Shorewall/releasenotes.txt b/Shorewall/releasenotes.txt index a6a11e0be..83f7b69db 100644 --- a/Shorewall/releasenotes.txt +++ b/Shorewall/releasenotes.txt @@ -446,6 +446,9 @@ V I. P R O B L E M S C O R R E C T E D A N D N E W F E A T U R E S Use of tunN in the nat and netmap files also produced invalid iptables-restore input. +2) '/sbin/shorewall version -a' now shows the versions of all installed + Shorewall packages. + ---------------------------------------------------------------------------- N E W F E A T U R E S I N 4 . 4 . 9 ---------------------------------------------------------------------------- diff --git a/Shorewall/shorewall b/Shorewall/shorewall index 7cc0f5e42..f860f9213 100755 --- a/Shorewall/shorewall +++ b/Shorewall/shorewall @@ -1508,6 +1508,7 @@ version_command() { finished=0 local all all= + local product while [ $finished -eq 0 -a $# -gt 0 ]; do option=$1 @@ -1540,7 +1541,22 @@ version_command() { [ $# -gt 0 ] && usage 1 - echo $SHOREWALL_VERSION + if [ -n "$all" ]; then + for product in shorewall shorewall6 shorewall-lite shorewall6-lite shorewall-init; do + if [ -f /usr/share/$product/version ]; then + case $product in + shorewall) + echo $SHOREWALL_VERSION + ;; + *) + echo "$product: $(cat /usr/share/$product/version)" + ;; + esac + fi + done + else + echo $SHOREWALL_VERSION + fi }