diff --git a/lib/ulib/base b/lib/ulib/base index 40c523d..711cb8b 100644 --- a/lib/ulib/base +++ b/lib/ulib/base @@ -1728,11 +1728,13 @@ function ensure_user() { } function check_hostname() { # Vérifier si le hostname courant est l'un des hôtes $1..* +# localhost matche toujours local userhost user host path for userhost in "$@"; do splitfsep "$userhost" : userhost path splituserhost "$userhost" user host - [ "$MYHOSTNAME" == "${host%%.*}" ] && return 0 + host="${host%%.*}" + [ "$host" == localhost -o "$host" == "$MYHOSTNAME" ] && return 0 done return 1 }