Fix the returned value of IpAddress
This commit is contained in:
parent
f5ef9d67b1
commit
285aa8d6f0
|
@ -84,7 +84,7 @@ function IpAddress() {
|
||||||
printf '\e[1;31m%-6s\e[m\n' "ERREUR : Impossible de récupérer l'adresse IP de cette machine (${strMyIpAddress})."
|
printf '\e[1;31m%-6s\e[m\n' "ERREUR : Impossible de récupérer l'adresse IP de cette machine (${strMyIpAddress})."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
echo "{$strMyIpAddress}"
|
echo "${strMyIpAddress}"
|
||||||
}
|
}
|
||||||
## }}}
|
## }}}
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ function MyFqdn() {
|
||||||
local strMyIpAddress
|
local strMyIpAddress
|
||||||
local strMyFqdn
|
local strMyFqdn
|
||||||
strMyIpAddress=$( IpAddress ) # eg '129.20.27.49'
|
strMyIpAddress=$( IpAddress ) # eg '129.20.27.49'
|
||||||
strMyFqdn=$(host "$strMyIpAddress" | awk '{print $5}')
|
strMyFqdn=$(host "${strMyIpAddress}" | awk '{print $5}')
|
||||||
echo "${strMyFqdn%?}" # remove the trailing '.'
|
echo "${strMyFqdn%?}" # remove the trailing '.'
|
||||||
}
|
}
|
||||||
## }}}
|
## }}}
|
||||||
|
|
Loading…
Reference in New Issue