From b27d089ffdecd90c42dc652bf53b8d03b3e96550 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Wed, 28 Feb 2024 22:15:31 -0600 Subject: [PATCH] update --- defaults.inc | 2 +- inc/status.inc | 41 +++++++++++++++++++++++++++-------------- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/defaults.inc b/defaults.inc index e5921843..89245024 100755 --- a/defaults.inc +++ b/defaults.inc @@ -1,6 +1,6 @@ #!/usr/bin/env bash -VERS='5.1.91-02202024' +VERS='5.1.92-02282024' NM_BETA=false noheader=' service status-check nightlyrephp7.3-fpm,new backup report check checkcerts gitea update-nodes copynpmcerts singleservercheck update-dyndns backup-offsitepfsense gui nightlyreview update log betacheck ' diff --git a/inc/status.inc b/inc/status.inc index 1b6333a4..bada7c4d 100755 --- a/inc/status.inc +++ b/inc/status.inc @@ -243,6 +243,8 @@ STATUS(){ checked=good elif [ -f ${STATUSRUN_TMPFOLDER}/repl.${rcheck}.${nip}.timeout ]; then checked=timeout + elif [ -f ${STATUSRUN_TMPFOLDER}/repl.${rcheck}.${nip}.skip ]; then + checked=skip fi if [ $(($(date +%s)-scanstart)) -gt 600 ]; then SENDNOTICE "NMG Scan Stuck" "NMG REPL check has been running for 10mins, klling all bash...." 1 @@ -278,6 +280,10 @@ It was down for $(SHOW_TIME $(expr $(date +%s) - $(stat -c %Y ${NM_TMPFOLDER}/${ rm -f ${NM_TMPFOLDER}/${nip}~${rcheck}.repl* fi ssh -q -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${nip} 'find ${NM_REPL_CHECK_LOC[${rcheck}]} -iname "*.sync-conflict-*" -exec rm {} \;' & + + elif [ "${checked}" == "skip" ]; then + [ "${STATUS_ACTION}" != "check" ] && echo -e "${idsCL[LightCyan]}Skipped${idsCL[Default]}" + fi done @@ -820,20 +826,27 @@ REPLCHECK(){ timeout=`date --date='1 minutes' +%s` # timeout=`date --date='30 seconds' +%s` - checked=false - until [ "${checked}" == "" ]; do - if [ "${PH_CMD}" == "" ]; then - ssh -q -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${nip} [[ -f ${NM_REPL_CHECK_LOC[${rcheck}]}/test.${STATUS_START//-/}.repl ]] && checked=`ssh -q -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${nip} "cat ${NM_REPL_CHECK_LOC[${rcheck}]}/test.${STATUS_START//-/}.repl" | diff - ${NM_REPL_CHECK_LOC[${rcheck}]}/test.${STATUS_START//-/}.repl` - else - ssh -q -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${nip} [[ -f ${NM_REPL_CHECK_LOC[${rcheck}]}/test.${STATUS_START//-/}.repl ]] && checked="`${PH_CMD} \"ssh -q -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${nip} \"cat ${NM_REPL_CHECK_LOC[${rcheck}]}/test.${STATUS_START//-/}.repl\" | diff - ${NM_REPL_CHECK_LOC[${rcheck}]}/test.${STATUS_START//-/}.repl\"`" - fi - if [ "`date +%s`" -gt "${timeout}" ]; then - timeout=true - break - fi - done - rm -f ${STATUSRUN_TMPFOLDER}/repl.${rcheck}.${nip}.running - [ "${timeout}" == "true" ] && touch ${STATUSRUN_TMPFOLDER}/repl.${rcheck}.${nip}.timeout || touch ${STATUSRUN_TMPFOLDER}/repl.${rcheck}.${nip}.good + if [ "${nip}" == "10.2.1.5" ] && [ "${rcheck}" == "pdns" ]; then + rm -f ${STATUSRUN_TMPFOLDER}/repl.${rcheck}.${nip}.running + touch ${STATUSRUN_TMPFOLDER}/repl.${rcheck}.${nip}.skip + else + checked=false + until [ "${checked}" == "" ]; do + if [ "${PH_CMD}" == "" ]; then + ssh -q -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${nip} [[ -f ${NM_REPL_CHECK_LOC[${rcheck}]}/test.${STATUS_START//-/}.repl ]] && checked=`ssh -q -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${nip} "cat ${NM_REPL_CHECK_LOC[${rcheck}]}/test.${STATUS_START//-/}.repl" | diff - ${NM_REPL_CHECK_LOC[${rcheck}]}/test.${STATUS_START//-/}.repl` + else + ssh -q -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${nip} [[ -f ${NM_REPL_CHECK_LOC[${rcheck}]}/test.${STATUS_START//-/}.repl ]] && checked="`${PH_CMD} \"ssh -q -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${nip} \"cat ${NM_REPL_CHECK_LOC[${rcheck}]}/test.${STATUS_START//-/}.repl\" | diff - ${NM_REPL_CHECK_LOC[${rcheck}]}/test.${STATUS_START//-/}.repl\"`" + fi + if [ "`date +%s`" -gt "${timeout}" ]; then + timeout=true + break + fi + done + rm -f ${STATUSRUN_TMPFOLDER}/repl.${rcheck}.${nip}.running + [ "${timeout}" == "true" ] && touch ${STATUSRUN_TMPFOLDER}/repl.${rcheck}.${nip}.timeout || touch ${STATUSRUN_TMPFOLDER}/repl.${rcheck}.${nip}.good + fi + + } REPLSTART(){