Correction suite à test Shellchhek

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.
This commit is contained in:
Ldfa committed 2026-10-05 11:11:46 +02:00
1 parent 54e9f679b3
commit 6a44af5da9
1 file changed
+3 -2
+3 -2
View File
@@ -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 ---