From 125f3db295548c68498c26b71fae7f97327be876 Mon Sep 17 00:00:00 2001 From: Tim McCormack Date: Thu, 5 Oct 2023 15:18:20 +0000 Subject: [PATCH] fixup! Need to pass command to bash, apparently Apparently if you just use `$cmd`, it gets tokenized by spaces rather than having quotes and backslashes and such interpreted as you might expect in the shell. Since the mysql check commands are the first ones that have spaces in the command, I need to change this to `bash -c "$cmd"`. Apparently I had only tested the script with lms and such. (The correct way to build up a command and run it is instead with arrays, such as `"${cmd[@]}"`.) --- check.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check.sh b/check.sh index aa66cf7a57..973302ea88 100755 --- a/check.sh +++ b/check.sh @@ -43,7 +43,7 @@ run_check() { local cmd="$3" echo "> $cmd" set +e # Disable exit-on-error - if $cmd; then # Run the command itself and check if it succeeded. + if bash -c "$cmd"; then # Run the command itself and check if it succeeded. succeeded="$succeeded $check_name" else docker compose logs --tail 30 "$service" # Just show recent logs, not all history