From f5ef9d67b15246fd21b76916f375e33e1779429f Mon Sep 17 00:00:00 2001 From: GARDAIS Jeremy Date: Thu, 26 Apr 2018 15:19:10 +0200 Subject: [PATCH] Remove DEBUG messages for MyFqdn Cause the function is used to define the path of a file. --- install_backuppc_mac.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 '.' } ## }}}