From 6a44af5da990cfc931e7b965f05829b386dfbed6 Mon Sep 17 00:00:00 2001 From: Ldfa Date: Mon, 5 Oct 2026 11:11:46 +0200 Subject: [PATCH] =?UTF-8?q?Correction=20suite=20=C3=A0=20test=20Shellchhek?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Line 47: [[ $SSH_PORT =~ ^[0-9]+$ ]] && (( SSH_PORT >= 1 && SSH_PORT <= 65535 )) \ ^-- [SC2015](https://www.shellcheck.net/wiki/SC2015) (info): Note that A && B || C is not if-then-else. C may run when A is true. --- post-install_Claude.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/post-install_Claude.sh b/post-install_Claude.sh index 9c322c7..2d7830d 100644 --- a/post-install_Claude.sh +++ b/post-install_Claude.sh @@ -44,8 +44,9 @@ EOF check_prerequisites() { [[ $EUID -eq 0 ]] || die "Ce script doit être exécuté en root (sudo)." [[ -r /etc/debian_version ]] || die "Ce script est prévu pour Debian." - [[ $SSH_PORT =~ ^[0-9]+$ ]] && (( SSH_PORT >= 1 && SSH_PORT <= 65535 )) \ - || die "Port SSH invalide : ${SSH_PORT}" + if ! [[ $SSH_PORT =~ ^[0-9]+$ ]] || (( SSH_PORT < 1 || SSH_PORT > 65535 )); then + die "Port SSH invalide : ${SSH_PORT}" + fi } # --- Étapes ---