From 6fa3f89dc81c643a2d828a7351710d5bb0d57f6d Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Tue, 25 Apr 2023 16:48:09 -0500 Subject: [PATCH] Update nodemgmt-scripts.sh --- nodemgmt-scripts.sh | 39 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index dc415c95..dc5baf6f 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -748,34 +748,29 @@ NEWCERT(){ echo -e "${NEW_CERT}\n${daterun}" > ${FOLDER}/cert-request.lastrun yes | cp -rfH ${FOLDER}/cert-request.lastrun /opt/lb-data/letsencrypt/cert-request.lastrun DIVIDER true - - echo -en "${idsCL[LightYellow]}Waiting for Cert replication across the nodes... ${idsCL[Default]}" - for nip in "${LB_HOSTS[@]}"; do - checkhost=$(CHECK_HOST ${nip}) - if [ "${checkhost}" != "false" ]; then - if [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) != *"${nip}"* ]]; then - checked=false - until [ "${checked}" = "" ]; do - checked=`ssh root@${nip} "[ ! -f /opt/lb-data/letsencrypt/live/${MAIN_CERT}/newcert ] && echo '.'"` - done - fi - fi - done - rm -f /opt/lb-data/letsencrypt/live/${MAIN_CERT}/newcert - echo -e "${idsCL[Green]}Completed${idsCL[Default]}" - - echo echo -e -n "${idsCL[LightCyan]}Reload NGINX on LB Nodes (Y/n): ${idsCL[Default]}" read -n 1 NGINXRELOAD - showdivide=yes - if [[ ${NGINXRELOAD} =~ ^[Nn]$ ]] || [ "${NGINXRELOAD}" == "" ]; then - SERVICE nginx reload - elif [[ ${NGINXRELOAD} =~ ^[Nn]$ ]]; then + if [[ ${NGINXRELOAD} =~ ^[Nn]$ ]]; then tmp='' else + echo -en "${idsCL[LightYellow]}Waiting for Cert replication across the nodes... ${idsCL[Default]}" + for nip in "${LB_HOSTS[@]}"; do + checkhost=$(CHECK_HOST ${nip}) + if [ "${checkhost}" != "false" ]; then + if [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) != *"${nip}"* ]]; then + checked=false + until [ "${checked}" = "" ]; do + checked=`ssh root@${nip} "[ ! -f /opt/lb-data/letsencrypt/live/${MAIN_CERT}/newcert ] && echo '.'"` + done + fi + fi + done + rm -f /opt/lb-data/letsencrypt/live/${MAIN_CERT}/newcert + echo -e "${idsCL[Green]}Completed${idsCL[Default]}" + + echo SERVICE nginx reload fi - fi echo echo -e "${idsCL[Green]}Certificate has been successfully created for '${idsCL[Yellow]}${NEW_CERT}${idsCL[Green]}'...${idsCL[Default]}"