From afefed74e6c42a3c0fb28ed7b56502d620355b67 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sat, 25 Nov 2023 15:20:22 -0600 Subject: [PATCH] update --- defaults.inc | 2 +- inc/status.inc | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/defaults.inc b/defaults.inc index fdcb400f..9e9e2422 100755 --- a/defaults.inc +++ b/defaults.inc @@ -1,5 +1,5 @@ #!/usr/bin/env bash -VERS='4.15.27-11252023' +VERS='4.15.28-11252023' 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 ' CERT_DAEMON='/snap/bin/certbot' diff --git a/inc/status.inc b/inc/status.inc index 4a14af0a..b8217196 100755 --- a/inc/status.inc +++ b/inc/status.inc @@ -163,8 +163,7 @@ STATUS(){ fi if [ "${NCMD}" != "" ]; then checkhost=$(CHECK_HOST ${nip}) - [ "${checkhost}" != "false" ] && checkhostssl=$(ssh -o BatchMode=yes -o ConnectTimeout=3 root@${nip} echo ok 3>&1) || checkhostssl='' - echo "HERE: $checkhost - $checkhostssl" + [ "${checkhost}" != "false" ] && checkhostssl=$(ssh -o BatchMode=yes -o ConnectTimeout=3 root@${nip} echo ok 3>&1) else checkhost=true checkhostssl=ok @@ -447,7 +446,7 @@ STATUS(){ fi if [ "${ST_ACTION}" != "check" ]; then toterrtime=`date +%s`-$(stat -c %Y ${NM_TMPFOLDER}/${nip}.errtime) - if [ "${checkhostssl}" != "" ]; then + if [ "${checkhost}" != "false" ]; then echo -e "${idsCL[Red]} - Node is online, but SSL is down!${idsCL[Default]}" else @@ -460,20 +459,20 @@ STATUS(){ toterrtime=`date +%s`-$(stat -c %Y ${NM_TMPFOLDER}/${nip}.errtime) errtime=`date +%s`-$(stat -c %Y ${NM_TMPFOLDER}/${nip}.down) if [ "${ST_ACTION}" != "check" ]; then - if [ "${checkhostssl}" != "" ]; then + if [ "${checkhost}" != "false" ]; then echo -e "${idsCL[Red]} - Node SSL has been down for $(SHOW_TIME ${toterrtime}) ${idsCL[LightYello]}${LH}${idsCL[Default]}" else echo -e "${idsCL[Red]} - Node has been down for $(SHOW_TIME ${toterrtime}) ${idsCL[LightYello]}${LH}${idsCL[Default]}" fi fi if [ $errtime -gt ${NM_RENOTIFY_TIMEOUT} ]; then - if [ "${checkhostssl}" != "" ]; then + if [ "${checkhost}" != "false" ]; then SENDNOTICE "${NM_HOSTNAMES[${nip}]}[${nip}]" "${NM_HOSTNAMES[${nip}]}[${nip}] SSL has been down for $(SHOW_TIME ${toterrtime})" 1 else SENDNOTICE "${NM_HOSTNAMES[${nip}]}[${nip}]" "${NM_HOSTNAMES[${nip}]}[${nip}] has been down for $(SHOW_TIME ${toterrtime})" 1 fi elif [ $errtime -gt 60 ] && [ $errtime -lt 180 ] && [ ! -f ${NM_TMPFOLDER}/${nip}.errtime ]; then - if [ "${checkhostssl}" != "" ]; then + if [ "${checkhost}" != "false" ]; then SENDNOTICE "${NM_HOSTNAMES[${nip}]}[${nip}]" "${NM_HOSTNAMES[${nip}]}[${nip}] is online, but SSL is down" 1 else SENDNOTICE "${NM_HOSTNAMES[${nip}]}[${nip}]" "${NM_HOSTNAMES[${nip}]}[${nip}] is down" 1