From efe3258bd49a5f2b549d6470984cb8b4170a45ba Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Thu, 18 Apr 2024 11:30:47 +0200 Subject: [PATCH] Use '[engine]-compose' command instead of '[engine] compose' for compatibility with old installation --- check_container_upgrade | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/check_container_upgrade b/check_container_upgrade index 6f92a46..dc80aca 100755 --- a/check_container_upgrade +++ b/check_container_upgrade @@ -147,7 +147,10 @@ CHECKED_CONTAINERS=( ) debug "List running containers..." if [ -n "$DOCKERCOMPOSE_FILE" ] then - RUNNING_CONTAINERS=$($ENGINE compose -f $DOCKERCOMPOSE_FILE ps --format '{{.Service}}' | tr '\n' ' ') + which "${ENGINE}-compose" > /dev/null 2>&1 \ + && COMPOSE_BIN="${ENGINE}-compose" \ + || COMPOSE_BIN="$ENGINE compose" + RUNNING_CONTAINERS=$($COMPOSE_BIN -f $DOCKERCOMPOSE_FILE ps --format '{{.Service}}' | tr '\n' ' ') else RUNNING_CONTAINERS=$($ENGINE ps --format '{{.Names}}' | tr '\n' ' ') fi @@ -158,7 +161,7 @@ function exec_in_container() { shift; if [ -n "$DOCKERCOMPOSE_FILE" ] then - $ENGINE compose -f $DOCKERCOMPOSE_FILE exec $container $@ + $COMPOSE_BIN -f $DOCKERCOMPOSE_FILE exec $container $@ return $? fi $ENGINE exec $container $@