From cdf36198e28ead9d747e0b80801395acb43663c3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Fri, 5 Sep 2025 21:11:50 +0200 Subject: [PATCH] fix(docker-upgrade.sh): only require jq when telegram is enabled MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- scripts/docker-upgrade.sh | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/scripts/docker-upgrade.sh b/scripts/docker-upgrade.sh index 702b261..52f4e37 100755 --- a/scripts/docker-upgrade.sh +++ b/scripts/docker-upgrade.sh @@ -109,6 +109,15 @@ escape_telegram_markdown() { } send_telegram_message() { + if ! command -v jq >/dev/null 2>&1; then + echo_timestamped "Error: jq not found in PATH" + exit 1 + fi + if ! command -v curl >/dev/null 2>&1; then + echo_timestamped "Error: curl not found, cannot send telegram message" + return 1 + fi + if [ -z "${FREQTRADE_CONFIG_JSON:-}" ]; then FREQTRADE_CONFIG_JSON=$(jsonc_to_json "$FREQTRADE_CONFIG" 2>/dev/null || echo "") fi @@ -119,11 +128,6 @@ send_telegram_message() { return 0 fi - if ! command -v curl >/dev/null 2>&1; then - echo_timestamped "Error: curl not found, cannot send telegram message" - return 1 - fi - telegram_message=$(escape_telegram_markdown "$1") if [ -z "$telegram_message" ]; then echo_timestamped "Error: message variable is empty" @@ -145,11 +149,6 @@ send_telegram_message() { fi } -if ! command -v jq >/dev/null 2>&1; then - echo_timestamped "Error: jq not found in PATH" - exit 1 -fi - if ! command -v docker >/dev/null 2>&1; then echo_timestamped "Error: docker not found in PATH" exit 1 -- 2.43.0