From 687814203b29bd00049d6d8fa95dbe22b14f7684 Mon Sep 17 00:00:00 2001 From: OrpheeGT Date: Fri, 21 Apr 2023 17:23:19 +0200 Subject: [PATCH] Disable docker run command if image not available locally Disable docker run command if image not available locally --- deploy/synology_dsm.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/deploy/synology_dsm.sh b/deploy/synology_dsm.sh index cbaa92b9..17925072 100644 --- a/deploy/synology_dsm.sh +++ b/deploy/synology_dsm.sh @@ -98,8 +98,9 @@ synology_dsm_deploy() { otp_code="$(oathtool --base32 --totp "${SYNO_TOTP_SECRET}" 2>/dev/null)" elif _exists docker; then if [[ "$(docker images -q toolbelt/oathtool:latest 2> /dev/null)" == "" ]]; then - read -e -p "docker is available but oathtool docker image must be downloaded, do you want to download it (Y) or abort (N) ? " choice - [[ "$choice" == [Yy]* ]] && docker image pull toolbelt/oathtool:latest && otp_code="$(docker run --rm -it toolbelt/oathtool --base32 --totp "${SYNO_TOTP_SECRET}" 2>/dev/null | cut -b 1-6)" || { _err "Abort requested or download failed"; return 1; } + _err "docker is available but oathtool docker image must be downloaded manually" + _err "Please execute manually 'docker image pull toolbelt/oathtool:latest' and relaunch the deployment" + return 1 else otp_code="$(docker run --rm -it toolbelt/oathtool --base32 --totp "${SYNO_TOTP_SECRET}" 2>/dev/null | cut -b 1-6)" fi