From 17e20b8ad62a1e3bd75a36ffe4ad8867d686016d Mon Sep 17 00:00:00 2001 From: jeanotx32 Date: Mon, 18 May 2026 22:58:53 -0400 Subject: [PATCH] fix: check_root incompatible with set -e when running as root --- vps-monitor/agent/install.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vps-monitor/agent/install.sh b/vps-monitor/agent/install.sh index e19bf14..de9d34a 100755 --- a/vps-monitor/agent/install.sh +++ b/vps-monitor/agent/install.sh @@ -55,7 +55,11 @@ while [[ $# -gt 0 ]]; do done # ─── Vérifications communes ─────────────────────────────────────────────────── -check_root() { [[ $EUID -ne 0 ]] && error "Ce script doit être exécuté en root (sudo)."; } +check_root() { + if [[ $EUID -ne 0 ]]; then + error "Ce script doit être exécuté en root (sudo)." + fi +} check_deps() { command -v python3 &>/dev/null || error "Python 3 est requis : apt install python3 python3-venv" command -v docker &>/dev/null || error "Docker est requis. Consultez https://docs.docker.com/engine/install/"