From b7bf5f5209dd9a4dcf49ca1b5ff06244d125cced Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Tue, 3 Jun 2025 20:53:49 -0500 Subject: [PATCH] update --- defaults.inc | 4 ++-- inc/services.inc | 4 ++-- inc/status.inc | 12 ++++++------ nodemgmt-scripts.sh | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/defaults.inc b/defaults.inc index dfc6c131..75130d0a 100755 --- a/defaults.inc +++ b/defaults.inc @@ -1,11 +1,11 @@ #!/usr/bin/env bash -VERS='5.5.16-06032025' +VERS='5.5.17-06032025' 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 offsite-staticroute-fix ' CERT_DAEMON='/opt/certbot/bin/certbot' -SSHCMD='ssh -q -o ConnectTimeout=3 -o ConnectionAttempts=1' +SSHCMD='ssh -tq -o ConnectTimeout=3 -o ConnectionAttempts=1' declare -i errtime [ "${NM_FOLDER}" == "" ] && NM_FOLDER=/opt/idssys/nodemgmt diff --git a/inc/services.inc b/inc/services.inc index 17e3e4e8..4c2d4890 100755 --- a/inc/services.inc +++ b/inc/services.inc @@ -22,8 +22,8 @@ SINGLE_SERVER_SERVICE_CHECK(){ [ "${stc}" = "pdnsadmin" ] && stc="pdnsadmin.service pdnsadmin.socket" for nip in "${!hosts}"; do if [[ "${RUN_NODE_IP}" != *"${nip}"* ]] && [ "$(CHECK_HOST ${nip})" != "false" ]; then - ssh -tq -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${nip} 'systemctl is-active --quiet '${stc}' && /bin/systemctl stop '${stc} >/dev/null 2>&1 - ssh -tq -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${nip} '[ -f '${NM_TMPFOLDER}'/.singleserver.'${1^^}'.primary ] && rm -f '${NM_TMPFOLDER}'/.singleserver.'${1^^}'.primary' >/dev/null 2>&1 + ${SSHCMD} root@${nip} 'systemctl is-active --quiet '${stc}' && /bin/systemctl stop '${stc} >/dev/null 2>&1 + ${SSHCMD} root@${nip} '[ -f '${NM_TMPFOLDER}'/.singleserver.'${1^^}'.primary ] && rm -f '${NM_TMPFOLDER}'/.singleserver.'${1^^}'.primary' >/dev/null 2>&1 fi done done diff --git a/inc/status.inc b/inc/status.inc index 4167686b..2b79528b 100755 --- a/inc/status.inc +++ b/inc/status.inc @@ -517,18 +517,18 @@ STATUS_NODE(){ fi if [ "${NCMD}" != "" ] && [ ! -f ${STATUSRUN_TMPFOLDER}/.${nip}.* ]; then checkhost=$(CHECK_HOST ${nip}) - [ "${checkhost}" != "false" ] && checkhostssl=$(ssh -o BatchMode=yes -o ConnectTimeout=3 root@${nip} echo ok 2>&1) + [ "${checkhost}" != "false" ] && checkhostssh=$(ssh -o BatchMode=yes -o ConnectTimeout=3 root@${nip} echo ok 2>&1) elif [ -f ${STATUSRUN_TMPFOLDER}/.${nip}.up ]; then checkhost=true - checkhostssl=ok + checkhostssh=ok elif [ -f ${STATUSRUN_TMPFOLDER}/.${nip}.down ]; then checkhost=false - checkhostssl=no + checkhostssh=no else checkhost=true - checkhostssl=ok + checkhostssh=ok fi - if [ "${checkhost}" != "false" ] && [ "${checkhostssl}" == "ok" ]; then + if [ "${checkhost}" != "false" ] && [ "${checkhostssh}" == "ok" ]; then if [ ! -f ${STATUSRUN_TMPFOLDER}/.${nip}.up ]; then # [ "${NODETYPE}" != "OFW" ] && cpu_usage=$(${NCMD} "/opt/idssys/defaults/get-data.sh cpu-usage") || cpu_usage="" # if [ "${cpu_usage}" != "" ]; then @@ -877,7 +877,7 @@ STATUS_NODE(){ fi fi # SENDNOTICE "${NM_HOSTNAMES[${nip}]}[${nip}]" "${NM_HOSTNAMES[${nip}]}[${nip}] is down" 1 - [ "${checkhostssl}" != "ok" ] && echo "$(date +%Y-%m-%d-%H-%M-%S) - ${nip} - ${NM_HOSTNAMES[${nip}]}[${nip}] - Node is down" >> ${NM_LOGFILE} + [ "${checkhostssh}" != "ok" ] && echo "$(date +%Y-%m-%d-%H-%M-%S) - ${nip} - ${NM_HOSTNAMES[${nip}]}[${nip}] - Node is down" >> ${NM_LOGFILE} else #if [ ! -f ${NM_TMPFOLDER}/${nip}.disable ] && ([ "${nip}" = "10.2.1.5" ] || [[ "${nip}" != *"10.2."* ]] || ([[ "${nip}" = *"10.2."* ]] && [ ! -f ${PW_TMPFOLDER}/OFF-vMS-Host1.down ])) && [ ! -f ${NM_TMPFOLDER}/${nip}.errtime ] && [ $(expr $(date +%s) - $(stat -c %Y ${NM_TMPFOLDER}/${nip}.down)) -gt 60 ]; then if [ ! -f ${NM_TMPFOLDER}/${nip}.disable ] && [ ! -f ${NM_TMPFOLDER}/${nip}.errtime ] && [ $(expr $(date +%s) - $(stat -c %Y ${NM_TMPFOLDER}/${nip}.down)) -gt 60 ]; then diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index a17e64bf..82342fd8 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -401,7 +401,7 @@ NODEUPDATE(){ else noup=0 fi - NCMD="ssh -tq -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${nip}" + NCMD="${SSHCMD} root@${nip}" NODE="${NM_HOSTNAMES[${nip}]} [${nip}]" tmpfile=/tmp/.nodeupdate.${NM_HOSTNAMES[${nip}]// /-} @@ -1271,7 +1271,7 @@ LIST_SKIPPED_SERVERS(){ GETSKIP(){ nip="${1}" - NCMD="ssh -tq -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${nip}" + NCMD="${SSHCMD} root@${nip}" if [ "${2}" == "" ]; then NODE="${NM_HOSTNAMES[${nip}]} [${nip}]"