From 8032907206ddeb33f01ff1c1bf6019ec0dc580f5 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Wed, 6 Feb 2019 14:22:44 -0600 Subject: [PATCH] Update nodemgmt-scripts.sh --- nodemgmt-scripts.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index a0ad2ff7..b1c1a9a2 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -77,10 +77,16 @@ NEWCERT(){ if [ -f /etc/letsencrypt/live/${NEW_CERT}/cert.pem ]; then do_with_root chown -R root:letsencrypt /etc/letsencrypt do_with_root chmod -R 6775 /etc/letsencrypt - until [ $(`ssh root@10.5.10.52 "cat /etc/letsencrypt/live/${NEW_CERT}/cert.pem" | diff - /etc/letsencrypt/live/${NEW_CERT}/cert.pem`) = 0 ]; do - echo -e "${idsCL[LightYellow]}Waiting for certifcate replication between the nodes...${idsCL[Default]}" - echo "" + echo -en "${idsCL[LightYellow]}Waiting for certifcate replication between the nodes... ${idsCL[Default]}" + until [ "${same}" = "true" ]; do + same1=`ssh root@10.5.10.52 "cat /etc/letsencrypt/live/${NEW_CERT}/fullchain.pem" | diff - /etc/letsencrypt/live/${NEW_CERT}/fullchain.pem` + same2=`ssh root@10.5.10.53 "cat /etc/letsencrypt/live/${NEW_CERT}/fullchain.pem" | diff - /etc/letsencrypt/live/${NEW_CERT}/fullchain.pem` + if [ "${same1}" = "" ] && [ "${same2}" = "" ] + then same="true" + else same="false" + fi done + echo -e "${idsCL[Green]}Completed${idsCL[Default]}" #sleep 20 SERVICE nginx reload