mirror of
https://gitlab.com/shorewall/code.git
synced 2025-06-20 09:47:51 +02:00
Move show_status() to before its first reference
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
1308560aba
commit
a2345325dd
@ -1532,6 +1532,49 @@ dump_filter_wrapper() {
|
|||||||
eval dump_filter $g_pager
|
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
|
# Dump Command Executor
|
||||||
#
|
#
|
||||||
@ -3332,49 +3375,6 @@ report_capabilities1() {
|
|||||||
report_capabilities_unsorted1 | sort
|
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() {
|
interface_status() {
|
||||||
case $(cat $1) in
|
case $(cat $1) in
|
||||||
0)
|
0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user