check_systemd_service: modify output when a service is allowed disabled
This commit is contained in:
parent
0eab3624e8
commit
dafd6236bc
|
@ -91,9 +91,23 @@ if [ -n "$end_time" ] && [ "$end_time" != "n/a" ] && [ -z "$end_time" ]; then
|
|||
end_time_str=" Exited at $end_time."
|
||||
fi
|
||||
|
||||
# =============
|
||||
# Build output
|
||||
|
||||
if [ "$IS_TIMER" = true ] && { [ "$substate" = "exited" ] || [ "$active" = "inactive" ]; }; then
|
||||
echo "OK - $UNIT_NAME is active and exited (returned $exit_code) and enabled.$end_time_str $end_time_diff_perf"
|
||||
status="exited (returned $exit_code)"
|
||||
else
|
||||
echo "OK - $UNIT_NAME is active and enabled.$start_time_str $start_time_diff_perf"
|
||||
status="active"
|
||||
fi
|
||||
|
||||
if [ "$enabled" = "enabled" ] || [ "$IS_ALLOWED_DISABLED" != true ]; then
|
||||
status+=" and enabled"
|
||||
fi
|
||||
|
||||
if [ "$IS_TIMER" = true ] && { [ "$substate" = "exited" ] || [ "$active" = "inactive" ]; }; then
|
||||
echo "OK - $UNIT_NAME is $status.$end_time_str $end_time_diff_perf"
|
||||
else
|
||||
echo "OK - $UNIT_NAME is $status.$start_time_str $start_time_diff_perf"
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
|
Loading…
Reference in New Issue