This commit is contained in:
2019-02-07 09:28:27 -06:00
parent 3253c06232
commit 388180256f
2 changed files with 50 additions and 1 deletions

View File

@@ -53,7 +53,39 @@ STATUS() {
done
nid=`expr $nid + 1`
done
echo
echo -e "${idsCL[Yellow]} Replication Status${idsCL[Default]}"
DIVIDER
checked=false
timeout=`date --date='2 minutes' +%s`
until [ "${checked}" = "" ]; do
tchecked=''
for nip in "${NODE_HOSTS[@]}"; do
if [[ $(/sbin/ip -o -4 addr list ens192 | awk '{print $4}' | cut -d/ -f1) == *"${nip}"* ]]; then NCMD=''
else NCMD="ssh root@${nip}"
fi
if [ "${NCMD}" != "" ]; then
tchecked+=`${NCMD} "cat /etc/letsencrypt/cert-renewal.lastrun" | diff - /etc/letsencrypt/cert-renewal.lastrun`
fi
done
checked=${tchecked}
if [ "`date +%s`" -gt "$timeout" ]; then
echo -e "${idsCL[Red]}Timeout${idsCL[Default]}"
timeout=true
echo "Timeout occured in waiting for replication between nodes." | mail -s "Cert-Renewal" ${STATUS_CHECK_EMAIL}
break
fi
done
if [ "${timeout}" != "true" ]; then
echo -e "${idsCL[Green]}Completed${idsCL[Default]}"
fi
echo ""
if [ -z $action ] || [ "${action}" = "gui" ]; then