reconnaitre la valeur spéciale localhost pour check_hostname()
This commit is contained in:
parent
4039b94a88
commit
94b2b48c19
|
@ -1728,11 +1728,13 @@ function ensure_user() {
|
||||||
}
|
}
|
||||||
function check_hostname() {
|
function check_hostname() {
|
||||||
# Vérifier si le hostname courant est l'un des hôtes $1..*
|
# Vérifier si le hostname courant est l'un des hôtes $1..*
|
||||||
|
# localhost matche toujours
|
||||||
local userhost user host path
|
local userhost user host path
|
||||||
for userhost in "$@"; do
|
for userhost in "$@"; do
|
||||||
splitfsep "$userhost" : userhost path
|
splitfsep "$userhost" : userhost path
|
||||||
splituserhost "$userhost" user host
|
splituserhost "$userhost" user host
|
||||||
[ "$MYHOSTNAME" == "${host%%.*}" ] && return 0
|
host="${host%%.*}"
|
||||||
|
[ "$host" == localhost -o "$host" == "$MYHOSTNAME" ] && return 0
|
||||||
done
|
done
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue