From a2345325dd8c991730e7a29eda1972bc4ec95ca9 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Fri, 29 Apr 2016 15:31:55 -0700 Subject: [PATCH] Move show_status() to before its first reference Signed-off-by: Tom Eastep --- Shorewall-core/lib.cli | 86 +++++++++++++++++++++--------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/Shorewall-core/lib.cli b/Shorewall-core/lib.cli index 89aea4fc2..bc9318b77 100644 --- a/Shorewall-core/lib.cli +++ b/Shorewall-core/lib.cli @@ -1532,6 +1532,49 @@ dump_filter_wrapper() { eval dump_filter $g_pager } +show_status() { + local compiletime + local state + + if product_is_started ; then + [ $VERBOSITY -ge 1 ] && echo "$g_product is running" + status=0 + else + [ $VERBOSITY -ge 1 ] && echo "$g_product is stopped" + status=4 + fi + + if [ -f ${VARDIR}/state ]; then + state="$(cat ${VARDIR}/state)" + case $state in + Stopped*|Closed*|Clear*) + status=3 + ;; + esac + else + state=Unknown + fi + + if [ $VERBOSITY -ge 1 ]; then + if [ -f $g_firewall ]; then + compiletime=$(run_it $g_firewall info 2>/dev/null) + + case $compiletime in + compiled\ *) + state="$state ($g_firewall $compiletime)" + ;; + *) + state="$state ($g_firewall compiled by Shorewall version $(run_it $g_firewall version))" + ;; + esac + fi + + echo "State:$state" + echo + fi + +} + # # Dump Command Executor # @@ -3332,49 +3375,6 @@ report_capabilities1() { report_capabilities_unsorted1 | sort } -show_status() { - local compiletime - local state - - if product_is_started ; then - [ $VERBOSITY -ge 1 ] && echo "$g_product is running" - status=0 - else - [ $VERBOSITY -ge 1 ] && echo "$g_product is stopped" - status=4 - fi - - if [ -f ${VARDIR}/state ]; then - state="$(cat ${VARDIR}/state)" - case $state in - Stopped*|Closed*|Clear*) - status=3 - ;; - esac - else - state=Unknown - fi - - if [ $VERBOSITY -ge 1 ]; then - if [ -f $g_firewall ]; then - compiletime=$(run_it $g_firewall info 2>/dev/null) - - case $compiletime in - compiled\ *) - state="$state ($g_firewall $compiletime)" - ;; - *) - state="$state ($g_firewall compiled by Shorewall version $(run_it $g_firewall version))" - ;; - esac - fi - - echo "State:$state" - echo - fi - -} - interface_status() { case $(cat $1) in 0)