From a48427c4120c0f07c6069af49c1abd6018138fe4 Mon Sep 17 00:00:00 2001 From: GARDAIS Jeremy Date: Fri, 8 Dec 2017 08:49:44 +0100 Subject: [PATCH] Ensure to test if the entry really exist in /etc/hosts. --- server/add_backuppc_host.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/add_backuppc_host.sh b/server/add_backuppc_host.sh index 6871afb..529aa9b 100755 --- a/server/add_backuppc_host.sh +++ b/server/add_backuppc_host.sh @@ -129,7 +129,7 @@ EOF fi #### DÉFINIR LE NOM D'HOTE POUR LE SYSTEME #### -if [[ ! $(grep "${ip}" "${system_hosts}") ]]; then +if [[ ! $(grep "${ip} ${username}.${hostname}" "${system_hosts}") ]]; then echo "${ip} ${username}.${hostname}" >> "${system_hosts}" #echo "WRITE TO ${system_hosts}: ${ip} ${username}.${hostname}" else