This commit is contained in:
2023-04-25 12:26:35 -05:00
parent c77dc4c168
commit 176056264b
2 changed files with 18 additions and 2 deletions

View File

@@ -1,9 +1,9 @@
#!/usr/bin/env bash
VERS='4.3.13-04252023'
VERS='4.3.15-04252023'
NODETYPES=MYSQL,LB,WEB,NC,WPD,LPD,PW
#NODETYPES=WPD,LPD,PW
#NODETYPES=WPD,LPD,PW.
MYSQLHOSTS=10.10.1.51,10.10.1.52
WEBHOSTS=10.10.1.121,10.10.1.122
LBHOSTS=10.10.10.81,10.10.10.82

View File

@@ -740,12 +740,28 @@ NEWCERT(){
if [ -f /etc/letsencrypt/live/${MAIN_CERT}/cert.pem ]; then
chown -R root:le /opt/lb-data/letsencrypt
chmod -R 6775 /opt/lb-data/letsencrypt
touch /etc/letsencrypt/live/${MAIN_CERT}/newcert
if [ -f /etc/nginx/sites-enabled/${MAIN_CERT}.conf ]; then
rm -f ${FOLDER}/cert-request.lastrun
daterun=`date +%Y-%m-%d-%H-%M-%S`
echo -e "${NEW_CERT}\n${daterun}" > ${FOLDER}/cert-request.lastrun
yes | cp -rfH ${FOLDER}/cert-request.lastrun /etc/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 /etc/letsencrypt/live/${MAIN_CERT}/newcert ] && echo '.'"`
done
fi
fi
done
rm -f /etc/letsencrypt/live/${MAIN_CERT}/newcert
echo -e "${idsCL[Green]}Completed${idsCL[Default]}"
SERVICE nginx reload
fi
echo