diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index b6ca191e..a0ad2ff7 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -77,9 +77,12 @@ 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 - echo -e "${idsCL[LightYellow]}Waiting for certifcate replication between the nodes...${idsCL[Default]}" - echo "" - sleep 20 + 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 "" + done + + #sleep 20 SERVICE nginx reload echo -e "${idsCL[Green]}Certificate has been successfully created for '${idsCL[Yellow]}${NEW_CERT}${idsCL[Green]}'...${idsCL[Default]}" else