update
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
VERS='4.3.13-04252023'
|
VERS='4.3.15-04252023'
|
||||||
|
|
||||||
NODETYPES=MYSQL,LB,WEB,NC,WPD,LPD,PW
|
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
|
MYSQLHOSTS=10.10.1.51,10.10.1.52
|
||||||
WEBHOSTS=10.10.1.121,10.10.1.122
|
WEBHOSTS=10.10.1.121,10.10.1.122
|
||||||
LBHOSTS=10.10.10.81,10.10.10.82
|
LBHOSTS=10.10.10.81,10.10.10.82
|
||||||
|
|||||||
@@ -740,12 +740,28 @@ NEWCERT(){
|
|||||||
if [ -f /etc/letsencrypt/live/${MAIN_CERT}/cert.pem ]; then
|
if [ -f /etc/letsencrypt/live/${MAIN_CERT}/cert.pem ]; then
|
||||||
chown -R root:le /opt/lb-data/letsencrypt
|
chown -R root:le /opt/lb-data/letsencrypt
|
||||||
chmod -R 6775 /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
|
if [ -f /etc/nginx/sites-enabled/${MAIN_CERT}.conf ]; then
|
||||||
rm -f ${FOLDER}/cert-request.lastrun
|
rm -f ${FOLDER}/cert-request.lastrun
|
||||||
daterun=`date +%Y-%m-%d-%H-%M-%S`
|
daterun=`date +%Y-%m-%d-%H-%M-%S`
|
||||||
echo -e "${NEW_CERT}\n${daterun}" > ${FOLDER}/cert-request.lastrun
|
echo -e "${NEW_CERT}\n${daterun}" > ${FOLDER}/cert-request.lastrun
|
||||||
yes | cp -rfH ${FOLDER}/cert-request.lastrun /etc/letsencrypt/cert-request.lastrun
|
yes | cp -rfH ${FOLDER}/cert-request.lastrun /etc/letsencrypt/cert-request.lastrun
|
||||||
DIVIDER true
|
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
|
SERVICE nginx reload
|
||||||
fi
|
fi
|
||||||
echo
|
echo
|
||||||
|
|||||||
Reference in New Issue
Block a user