From: Jérôme Benoit Date: Fri, 5 Sep 2025 19:11:50 +0000 (+0200) Subject: fix(docker-upgrade.sh): only require jq when telegram is enabled X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=cdf36198e28ead9d747e0b80801395acb43663c3;p=freqai-strategies.git fix(docker-upgrade.sh): only require jq when telegram is enabled Signed-off-by: Jérôme Benoit --- 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