mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-30 17:22:33 +00:00
scripts: Add helper function to collect script
Add a `have_service()` helper function to the data collection script to simplify the code. Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
This commit is contained in:
parent
80cdf895c5
commit
ae08ea3211
@ -141,6 +141,13 @@ have_cmd()
|
||||
[ $ret -eq 0 ]
|
||||
}
|
||||
|
||||
have_service()
|
||||
{
|
||||
local service="$1"
|
||||
|
||||
systemctl status "${service}" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
show_quoted_text()
|
||||
{
|
||||
local language="$1"
|
||||
@ -593,7 +600,7 @@ show_throttler_details()
|
||||
"kata-vc-throttler" \
|
||||
"vc-throttler"
|
||||
do
|
||||
systemctl status "${unit}" >/dev/null 2>&1 && \
|
||||
have_service "${unit}" && \
|
||||
run_cmd_and_show_quoted_output "" "systemctl show ${unit}"
|
||||
done
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user