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

@@ -3,6 +3,7 @@
VERS='1.02052019'
NODE_HOSTS=10.5.10.51,10.5.10.52,10.5.10.53
NODE_SERVICES=mysql,nginx,gitea,haproxy,keepalived,maxscale
REPL_CHECKS=
CERT_DAEMON='/usr/bin/certbot'
FOLDER=/opt/idssys/nodemgmt
SCRIPT=${FOLDER}/nodemgmt-scripts.sh
@@ -33,6 +34,22 @@ NM_SRVCOPTS['reload']='Reload'
NM_SRVCOPTS['enable']='Enabl'
NM_SRVCOPTS['disable']='Disabl'
declare -A REPL_CHECKS
REPL_CHECKS['nginx']='/etc/nginx'
REPL_CHECKS['ssl']='/etc/letsencrypt'
REPL_CHECKS['php']='/etc/php'
REPL_CHECKS['www']='/var/www'
REPL_CHECKS['git']='/var/lib/gitea'
REPL_CHECKS['gitssh']='/home/git'
declare -A REPL_DESC
REPL_DESC['nginx']= 'NGINX Settings'
REPL_DESC['ssl']= 'SSL Certificates'
REPL_DESC['php']= 'PHP Settings'
REPL_DESC['www']= 'Webserver Files'
REPL_DESC['git']= 'Gitea System'
REPL_DESC['gitssh']='Gitea SSH Keys'
NM_SRVCOPT=(start stop restart reload enable disable)
DISP_HEADER(){

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