This commit is contained in:
2019-02-11 12:12:26 -06:00
parent 3971cd0896
commit 7906ec6553
2 changed files with 6 additions and 5 deletions

View File

@@ -2,6 +2,7 @@
VERS='3.02112019' VERS='3.02112019'
NODEHOSTS=10.5.10.51,10.5.10.52,10.5.10.53 NODEHOSTS=10.5.10.51,10.5.10.52,10.5.10.53
PRIMARYHOST=10.5.10.51
NODESERVICES=mysql,nginx,gitea,haproxy,keepalived,maxscale NODESERVICES=mysql,nginx,gitea,haproxy,keepalived,maxscale
noheader=' service status-check nightlyrenew backup report check checkcerts ' noheader=' service status-check nightlyrenew backup report check checkcerts '
CERT_DAEMON='/usr/bin/certbot' CERT_DAEMON='/usr/bin/certbot'

View File

@@ -37,7 +37,7 @@ STATUS(){
echo echo
fi fi
if [ ! -z ${LOCAL_SERVICES+x} ]; if [ ! -z ${LOCAL_SERVICES+x} ];
then NHCMD='ssh root@10.5.10.51' then NHCMD="ssh root@${PRIMARYHOST}"
else NHCMD='' else NHCMD=''
fi fi
for rcheck in "${REPL_CHECK[@]}"; do for rcheck in "${REPL_CHECK[@]}"; do
@@ -217,7 +217,7 @@ STATUS(){
fi fi
nid=1 nid=1
for nip in "${NODE_HOSTS[@]}"; do for nip in "${NODE_HOSTS[@]}"; do
if [ "${nip}" = '10.5.10.51' ] && [ ! -z ${LOCAL_SERVICES+x} ]; then isreplhost=true; else isreplhost=false; fi if [ "${nip}" = "${PRIMARYHOST}" ] && [ ! -z ${LOCAL_SERVICES+x} ]; then isreplhost=true; else isreplhost=false; fi
if [[ $(/sbin/ip -o -4 addr list ens192 | awk '{print $4}' | cut -d/ -f1) != *"${nip}"* ]] && [ "${isreplhost}" = "false" ]; then if [[ $(/sbin/ip -o -4 addr list ens192 | awk '{print $4}' | cut -d/ -f1) != *"${nip}"* ]] && [ "${isreplhost}" = "false" ]; then
if [ "${ST_ACTION}" != "check" ]; then if [ "${ST_ACTION}" != "check" ]; then
echo -e " ${idsST[Bold]}${idsCL[LightCyan]}iDS-Node${nid} (${nip})${idsST[Reset]}${idsCL[Default]}" echo -e " ${idsST[Bold]}${idsCL[LightCyan]}iDS-Node${nid} (${nip})${idsST[Reset]}${idsCL[Default]}"
@@ -298,7 +298,7 @@ STATUS(){
# STATUS-CHECK(){ # STATUS-CHECK(){
# start=`date +%s` # start=`date +%s`
# if [ "${STATUS_CHECK_EMAIL}" != "" ]; then # if [ "${STATUS_CHECK_EMAIL}" != "" ]; then
# if [ ! -z ${LOCAL_SERVICES+x} ]; then NHCMD='ssh root@10.5.10.51' # if [ ! -z ${LOCAL_SERVICES+x} ]; then NHCMD="ssh root@${PRIMARYHOST}"
# else NHCMD=''; fi # else NHCMD=''; fi
# # for rcheck in "${REPL_CHECK[@]}"; do # # for rcheck in "${REPL_CHECK[@]}"; do
# # ${NHCMD} rm -f ${FOLDER}/test.repl # # ${NHCMD} rm -f ${FOLDER}/test.repl
@@ -369,7 +369,7 @@ STATUS(){
# ##REPLICATION CHECK # ##REPLICATION CHECK
# # nid=1 # # nid=1
# # for nip in "${NODE_HOSTS[@]}"; do # # for nip in "${NODE_HOSTS[@]}"; do
# # if [ "${nip}" = '10.5.10.51' ] && [ ! -z ${LOCAL_SERVICES+x} ]; then isreplhost=true; else isreplhost=false; fi # # if [ "${nip}" = "${PRIMARYHOST}" ] && [ ! -z ${LOCAL_SERVICES+x} ]; then isreplhost=true; else isreplhost=false; fi
# # if [[ $(/sbin/ip -o -4 addr list ens192 | awk '{print $4}' | cut -d/ -f1) != *"${nip}"* ]] && [ "${isreplhost}" = "false" ]; then # # if [[ $(/sbin/ip -o -4 addr list ens192 | awk '{print $4}' | cut -d/ -f1) != *"${nip}"* ]] && [ "${isreplhost}" = "false" ]; then
# # checkhost=$(CHECK_HOST ${nip}) # # checkhost=$(CHECK_HOST ${nip})
# # if [ "${checkhost}" != "false" ]; then # # if [ "${checkhost}" != "false" ]; then
@@ -579,7 +579,7 @@ NIGHTLYRENEW(){
LISTCERTS(){ LISTCERTS(){
if [ ! -z ${LOCAL_SERVICES+x} ]; then if [ ! -z ${LOCAL_SERVICES+x} ]; then
NCMD='ssh root@10.5.10.51' NCMD="ssh root@${PRIMARYHOST}"
${NCMD} rm -f /tmp/ssllist ${NCMD} rm -f /tmp/ssllist
${NCMD} 'for certdir in /etc/letsencrypt/live/*/ ; do echo $certdir; done' > /tmp/ssllist ${NCMD} 'for certdir in /etc/letsencrypt/live/*/ ; do echo $certdir; done' > /tmp/ssllist
else else