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