This commit is contained in:
2019-02-07 09:34:14 -06:00
parent 388180256f
commit e7a14361a3
2 changed files with 26 additions and 32 deletions

View File

@@ -79,7 +79,13 @@ DISP_HEADER(){
}
DIVIDER(){
echo -e "${idsCL[Yellow]}-----------------------------------------------------------------------${idsCL[Default]}"
if [ -z "$2" ]; then
clr='Yellow'
else
clr=$2
fi
}
echo -e "${idsCL[${clr}]}-----------------------------------------------------------------------${idsCL[Default]}"
if [ "$1" = true ]; then
echo ""
fi

View File

@@ -53,39 +53,27 @@ STATUS() {
done
nid=`expr $nid + 1`
done
echo
echo -e "${idsCL[Yellow]} Replication Status${idsCL[Default]}"
DIVIDER
checked=false
DIVIDER true
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
nid=1
for nip in "${NODE_HOSTS[@]}"
do
if [[ $(/sbin/ip -o -4 addr list ens192 | awk '{print $4}' | cut -d/ -f1) != *"${nip}"* ]]; then
echo -e "Node hostname: ${idsST[Bold]}${idsCL[LightCyan]}iDS-Node${nid} (${nip})${idsST[Reset]}${idsCL[Default]}"
DIVIDER false green
fi
nid=`expr $nid + 1`
done
if [ "${timeout}" != "true" ]; then
echo -e "${idsCL[Green]}Completed${idsCL[Default]}"
fi
echo ""
if [ -z $action ] || [ "${action}" = "gui" ]; then
@@ -176,7 +164,7 @@ NEWCERT(){
# if [ "`date +%s`" -gt "$timeout" ]; then
# echo -e "${idsCL[Red]}Timeout${idsCL[Default]}"
# timeout=true
# echo "Timeout occured in waiting for replication between nodes. (${NEW_CERT})" | mail -s "Cert-Request" ${STATUS_CHECK_EMAIL}
# echo "Timeout occurred in waiting for replication between nodes. (${NEW_CERT})" | mail -s "Cert-Request" ${STATUS_CHECK_EMAIL}
# break
# fi
# done
@@ -230,7 +218,7 @@ CERTRENEW(){
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}
echo "Timeout occurred in waiting for replication between nodes." | mail -s "Cert-Renewal" ${STATUS_CHECK_EMAIL}
break
fi
done
@@ -268,7 +256,7 @@ NIGHTLYRENEW(){
done
checked=${tchecked}
if [ "`date +%s`" -gt "$timeout" ]; then
echo "Timeout occured in waiting for replication between nodes." | mail -s "Nightly-Cert-Renewal" ${STATUS_CHECK_EMAIL}
echo "Timeout occurred in waiting for replication between nodes." | mail -s "Nightly-Cert-Renewal" ${STATUS_CHECK_EMAIL}
break
fi
done