diff --git a/Shorewall/shorewall b/Shorewall/shorewall index b16100328..87c66f3b8 100755 --- a/Shorewall/shorewall +++ b/Shorewall/shorewall @@ -1382,6 +1382,55 @@ usage() # $1 = exit status exit $1 } +version_command() { + local finished + finished=0 + local all + all= + local product + + while [ $finished -eq 0 -a $# -gt 0 ]; do + option=$1 + case $option in + -*) + option=${option#-} + + while [ -n "$option" ]; do + case $option in + -) + finished=1 + option= + ;; + a*) + all=Yes + option=${option#a} + ;; + *) + usage 1 + ;; + esac + done + shift + ;; + *) + finished=1 + ;; + esac + done + + [ $# -gt 0 ] && usage 1 + + echo $SHOREWALL_VERSION + + if [ -n "$all" ]; then + for product in shorewall6 shorewall-lite shorewall6-lite shorewall-init; do + if [ -f /usr/share/$product/version ]; then + echo "$product: $(cat /usr/share/$product/version)" + fi + done + fi +} + # # Execution begins here # @@ -1512,55 +1561,6 @@ while [ $finished -eq 0 ]; do esac done -version_command() { - local finished - finished=0 - local all - all= - local product - - while [ $finished -eq 0 -a $# -gt 0 ]; do - option=$1 - case $option in - -*) - option=${option#-} - - while [ -n "$option" ]; do - case $option in - -) - finished=1 - option= - ;; - a*) - all=Yes - option=${option#a} - ;; - *) - usage 1 - ;; - esac - done - shift - ;; - *) - finished=1 - ;; - esac - done - - [ $# -gt 0 ] && usage 1 - - echo $SHOREWALL_VERSION - - if [ -n "$all" ]; then - for product in shorewall6 shorewall-lite shorewall6-lite shorewall-init; do - if [ -f /usr/share/$product/version ]; then - echo "$product: $(cat /usr/share/$product/version)" - fi - done - fi -} - if [ $# -eq 0 ]; then usage 1 fi