Update nodemgmt-scripts.sh

This commit is contained in:
2019-02-06 21:22:26 -06:00
parent 473a8bf91f
commit 042608f347

View File

@@ -168,7 +168,7 @@ CERTRENEW(){
DIVIDER true
echo -en "${idsCL[LightYellow]}Waiting for certifcate replication between the nodes... ${idsCL[Default]}"
checked=false
timeout=`date --date='10 seconds' +%s`
timeout=`date --date='1 minutes' +%s`
until [ "${checked}" = "" ]; do
tchecked=''
for nip in "${NODE_HOSTS[@]}"; do
@@ -181,11 +181,12 @@ CERTRENEW(){
done
checked=${tchecked}
if [ "`date +%s`" -gt "$timeout" ]; then
echo 'timeout'
echo -e "${idsCL[Red]}Timeout${idsCL[Default]}"
echo "Timeout occured in waiting for replication between nodes." | mail -s "Nightly-Cert-Renewal" ${STATUS_CHECK_EMAIL}
break
fi
done
echo -e "${idsCL[Green]}Completed${idsCL[Default]}"
SERVICE nginx reload 2>&1 | tee -a /opt/idssys/nodemgmt/cert-renewal.lastrun
}
NIGHTLYRENEW(){
@@ -197,7 +198,7 @@ NIGHTLYRENEW(){
daterun=`date +%Y-%m-%d-%H-%M`
echo -e "${daterun}" >> /etc/letsencrypt/cert-renewal.lastrun
checked=false
timeout=`date --date='10 seconds' +%s`
timeout=`date --date='2 minutes' +%s`
until [ "${checked}" = "" ]; do
tchecked=''
for nip in "${NODE_HOSTS[@]}"; do
@@ -210,7 +211,7 @@ NIGHTLYRENEW(){
done
checked=${tchecked}
if [ "`date +%s`" -gt "$timeout" ]; then
echo "Timeout occured in waiting for replication between nodes." | mail -s "Cert-Renewal" ${STATUS_CHECK_EMAIL}
echo "Timeout occured in waiting for replication between nodes." | mail -s "Nightly-Cert-Renewal" ${STATUS_CHECK_EMAIL}
break
fi
done