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:
1 parent
54e9f679b3
commit
6a44af5da9
1 file changed
+3
-2
@@ -44,8 +44,9 @@ EOF
|
|||||||
check_prerequisites() {
|
check_prerequisites() {
|
||||||
[[ $EUID -eq 0 ]] || die "Ce script doit être exécuté en root (sudo)."
|
[[ $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."
|
[[ -r /etc/debian_version ]] || die "Ce script est prévu pour Debian."
|
||||||
[[ $SSH_PORT =~ ^[0-9]+$ ]] && (( SSH_PORT >= 1 && SSH_PORT <= 65535 )) \
|
if ! [[ $SSH_PORT =~ ^[0-9]+$ ]] || (( SSH_PORT < 1 || SSH_PORT > 65535 )); then
|
||||||
|| die "Port SSH invalide : ${SSH_PORT}"
|
die "Port SSH invalide : ${SSH_PORT}"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# --- Étapes ---
|
# --- Étapes ---
|
||||||
|
|||||||
Reference in new issue
Block a user