mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-08 08:44:05 +01:00
Include compile time and date in the output of 'shorewall status'
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
05a15c6f8b
commit
2a40012fc4
@ -3324,6 +3324,8 @@ report_capabilities1() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
show_status() {
|
show_status() {
|
||||||
|
local compiletime
|
||||||
|
|
||||||
if product_is_started ; then
|
if product_is_started ; then
|
||||||
[ $VERBOSITY -ge 1 ] && echo "$g_product is running"
|
[ $VERBOSITY -ge 1 ] && echo "$g_product is running"
|
||||||
status=0
|
status=0
|
||||||
@ -3345,7 +3347,16 @@ show_status() {
|
|||||||
|
|
||||||
if [ $VERBOSITY -ge 1 ]; then
|
if [ $VERBOSITY -ge 1 ]; then
|
||||||
if [ -f $g_firewall ]; then
|
if [ -f $g_firewall ]; then
|
||||||
state="$state ($g_firewall compiled by Shorewall version $($g_firewall version))"
|
compiletime=$($g_firewall date)
|
||||||
|
|
||||||
|
case $compiletime in
|
||||||
|
Usage*)
|
||||||
|
state="$state ($g_firewall compiled by Shorewall version $($g_firewall version))"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
state="$state ($g_firewall compiled $compiletime by Shorewall version $($g_firewall version))"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
fi
|
fi
|
||||||
echo "State:$state"
|
echo "State:$state"
|
||||||
echo
|
echo
|
||||||
|
@ -596,6 +596,17 @@ EOF
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# Generate date_command()
|
||||||
|
#
|
||||||
|
sub compile_date_command() {
|
||||||
|
my $date = localtime;
|
||||||
|
|
||||||
|
emit( "\ndate_command() {" ,
|
||||||
|
" echo $date" ,
|
||||||
|
"}" );
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# The Compiler.
|
# The Compiler.
|
||||||
#
|
#
|
||||||
@ -922,6 +933,10 @@ sub compiler {
|
|||||||
#
|
#
|
||||||
compile_updown;
|
compile_updown;
|
||||||
#
|
#
|
||||||
|
# Echo the compilation time and date
|
||||||
|
#
|
||||||
|
compile_date_command;
|
||||||
|
#
|
||||||
# Copy the footer to the script
|
# Copy the footer to the script
|
||||||
#
|
#
|
||||||
copy $globals{SHAREDIRPL} . 'prog.footer' unless $test;
|
copy $globals{SHAREDIRPL} . 'prog.footer' unless $test;
|
||||||
|
@ -25,6 +25,7 @@ usage() {
|
|||||||
echo " savesets <file>"
|
echo " savesets <file>"
|
||||||
echo " call <function> [ <parameter> ... ]"
|
echo " call <function> [ <parameter> ... ]"
|
||||||
echo " version"
|
echo " version"
|
||||||
|
echo " date"
|
||||||
echo
|
echo
|
||||||
echo "Options are:"
|
echo "Options are:"
|
||||||
echo
|
echo
|
||||||
@ -469,6 +470,10 @@ case "$COMMAND" in
|
|||||||
echo $SHOREWALL_VERSION
|
echo $SHOREWALL_VERSION
|
||||||
status=0
|
status=0
|
||||||
;;
|
;;
|
||||||
|
date)
|
||||||
|
[ $# -ne 1 ] && usage 2
|
||||||
|
date_command
|
||||||
|
;;
|
||||||
help)
|
help)
|
||||||
[ $# -ne 1 ] && usage 2
|
[ $# -ne 1 ] && usage 2
|
||||||
usage 0
|
usage 0
|
||||||
|
Loading…
Reference in New Issue
Block a user