Actualiser run.sh

ajout du contrôle pour voir si jq est installé

Signed-off-by: thomas <contact@thomasmlg.fr>
This commit is contained in:
2026-03-11 10:18:56 +01:00
parent 5c8da7892b
commit bc459c679a

22
run.sh
View File

@@ -24,6 +24,28 @@ log() {
echo "$1" >>"$RUN_LOG_ARCHIVE" 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() { send_matrix() {
local message="$1" local message="$1"