Restore -a functionality to the version command

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2010-05-29 08:59:45 -07:00
parent 50ce5bab68
commit e29d6d080d
3 changed files with 22 additions and 1 deletions

View File

@ -8,6 +8,8 @@ Changes in Shorewall 4.4.10
4) Add SAFESTOP option to /etc/default/shorewall* 4) Add SAFESTOP option to /etc/default/shorewall*
5) Restore -a functionality to the version command.
Changes in Shorewall 4.4.9 Changes in Shorewall 4.4.9
1) Auto-detection of bridges. 1) Auto-detection of bridges.

View File

@ -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 Use of tunN in the nat and netmap files also produced invalid
iptables-restore input. 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 N E W F E A T U R E S I N 4 . 4 . 9
---------------------------------------------------------------------------- ----------------------------------------------------------------------------

View File

@ -1508,6 +1508,7 @@ version_command() {
finished=0 finished=0
local all local all
all= all=
local product
while [ $finished -eq 0 -a $# -gt 0 ]; do while [ $finished -eq 0 -a $# -gt 0 ]; do
option=$1 option=$1
@ -1540,7 +1541,22 @@ version_command() {
[ $# -gt 0 ] && usage 1 [ $# -gt 0 ] && usage 1
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 $SHOREWALL_VERSION
;;
*)
echo "$product: $(cat /usr/share/$product/version)"
;;
esac
fi
done
else
echo $SHOREWALL_VERSION
fi
} }