From bc459c679a6288b2cf80453123aac84cf835a154 Mon Sep 17 00:00:00 2001 From: thomas Date: Wed, 11 Mar 2026 10:18:56 +0100 Subject: [PATCH] Actualiser run.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ajout du contrôle pour voir si jq est installé Signed-off-by: thomas --- run.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/run.sh b/run.sh index f9c4fef..0b9688d 100644 --- a/run.sh +++ b/run.sh @@ -24,6 +24,28 @@ log() { echo "$1" >>"$RUN_LOG_ARCHIVE" } +ensure_jq() { + if command -v jq >/dev/null 2>&1; then + return 0 + fi + + echo "📦 Installation de jq..." + + if command -v apt-get >/dev/null 2>&1; then + apt-get update >>"$RUN_LOG" 2>&1 + apt-get install -y jq >>"$RUN_LOG" 2>&1 + return 0 + fi + + if command -v apk >/dev/null 2>&1; then + apk add --no-cache jq >>"$RUN_LOG" 2>&1 + return 0 + fi + + echo "❌ Impossible d'installer jq automatiquement" + return 1 +} + send_matrix() { local message="$1"