diff --git a/install_backuppc_mac.sh b/install_backuppc_mac.sh index d88e7da..14ba659 100755 --- a/install_backuppc_mac.sh +++ b/install_backuppc_mac.sh @@ -76,10 +76,10 @@ function GetMyHostKey() { ## IpAddress {{{ function IpAddress() { + # Don't add DEBUG messages cause this function is called to define the path of a file local strMyIpAddress strMyIpAddress='' strMyIpAddress=$(dig +short myip.opendns.com @resolver1.opendns.com) - [[ "${DEBUG}" == "0" ]] && printf '\e[1;33m%-6s\e[m\n' "DEBUG : Fonction IpAddress - strMyIpAddress = ${strMyIpAddress}." if [ "${strMyIpAddress}" == '' ]; then printf '\e[1;31m%-6s\e[m\n' "ERREUR : Impossible de récupérer l'adresse IP de cette machine (${strMyIpAddress})." return 1 @@ -90,12 +90,11 @@ function IpAddress() { ## MyFqdn {{{ function MyFqdn() { + # Don't add DEBUG messages cause this function is called to define the path of a file local strMyIpAddress local strMyFqdn strMyIpAddress=$( IpAddress ) # eg '129.20.27.49' - [[ "${DEBUG}" == "0" ]] && printf '\e[1;33m%-6s\e[m\n' "DEBUG : Fonction MyFqdn - strMyIpAddress = ${strMyIpAddress}." strMyFqdn=$(host "$strMyIpAddress" | awk '{print $5}') - [[ "${DEBUG}" == "0" ]] && printf '\e[1;33m%-6s\e[m\n' "DEBUG : Fonction MyFqdn - strMyFqdn = ${strMyFqdn}." echo "${strMyFqdn%?}" # remove the trailing '.' } ## }}}