From 0768dae8c6c0701e4846fab88dceadb03661ac5a Mon Sep 17 00:00:00 2001 From: david Date: Tue, 31 Oct 2023 22:15:45 +0100 Subject: [PATCH] little fixes to v0.2.0 of watch-containers.sh --- watch-containers.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/watch-containers.sh b/watch-containers.sh index 6191047..b4e04b4 100755 --- a/watch-containers.sh +++ b/watch-containers.sh @@ -33,7 +33,7 @@ CHANGELOG=("[2023-10-30][v0.2.0] Complete rewrite based on the new template.sh" EXECUTABLE="$(basename $0)" LIBRARIES="lib.sh" DEPENDENCIES="basename dirname readlink cat jq docker" -REQUIRE_ROOT=0 +REQUIRE_ROOT=1 #TODO: make the cache file configurable with an option flag CACHE_FILE="/var/cache/watch-containers.json" @@ -160,11 +160,11 @@ done # Construct result if [[ -n "${ONLY_IN_CACHE[@]}" ]] && [[ -n "${ONLY_IN_CURRENT[@]}" ]]; then - RESULT=$(printf "Missing containers: %s\nNew containers: %s\n" "${ONLY_IN_CACHE[@]}" "${ONLY_IN_CURRENT[@]}") + RESULT=$(printf "Missing container(s): %s\nNew container(s): %s\n" "${ONLY_IN_CACHE[@]}" "${ONLY_IN_CURRENT[@]}") elif [[ -n "${ONLY_IN_CACHE[@]}" ]]; then - RESULT=$(printf "Missing containers: %s\n" "${ONLY_IN_CACHE[@]}") + RESULT=$(printf "Missing container(s): %s\n" "${ONLY_IN_CACHE[@]}") elif [[ -n "${ONLY_IN_CURRENT[@]}" ]]; then - RESULT=$(printf "New containers: %s\n" "${ONLY_IN_CURRENT[@]}") + RESULT=$(printf "New container(s): %s\n" "${ONLY_IN_CURRENT[@]}") else RESULT=$(printf "No changes detected") fi