Compare commits

..

2 commits

View file

@ -361,14 +361,15 @@ function exec_in_container() {
# Implement check inside a function to allow running it in parallel # Implement check inside a function to allow running it in parallel
# Parameters : [container] [output file] # Parameters : [container] [output file]
function check_container() { function check_container() {
local container="$1" output_file="$2" status="" check_plugin status ex local container="$1" output_file="$2" status="" check_plugin check_plugin_cmd=() status ex
for check_plugin in "${!CHECK_PLUGINS[@]}"; do for check_plugin in "${!CHECK_PLUGINS[@]}"; do
if ! exec_in_container "$container" test -e "$check_plugin" > /dev/null 2>&1; then if ! exec_in_container "$container" test -e "$check_plugin" > /dev/null 2>&1; then
debug "$container - Plugin $check_plugin not found" debug "$container - Plugin $check_plugin not found"
continue continue
fi fi
debug "$container - Plugin $check_plugin found, use it" debug "$container - Plugin $check_plugin found, use it"
status="$( exec_in_container "$container" "${CHECK_PLUGINS[${check_plugin}]}" 2>&1 )" read -ra check_plugin_cmd <<< "${CHECK_PLUGINS[${check_plugin}]}"
status="$( exec_in_container "$container" "${check_plugin_cmd[@]}" 2>&1 )"
ex=$? ex=$?
debug "$container - Plugin output: $status" debug "$container - Plugin output: $status"
debug "$container - Plugin exit code: $ex" debug "$container - Plugin exit code: $ex"