From 819bcf0e5c2d6171b8b41821a7c0ffc7905bd0d2 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Wed, 29 Nov 2023 10:41:37 -0600 Subject: [PATCH] update --- defaults.inc | 2 +- inc/status.inc | 22 ++++++++++++++++++---- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/defaults.inc b/defaults.inc index cf959373..d7435426 100755 --- a/defaults.inc +++ b/defaults.inc @@ -1,5 +1,5 @@ #!/usr/bin/env bash -VERS='4.16.13-11292023' +VERS='4.16.14-11292023' 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 f2ca5a08..15eb5607 100755 --- a/inc/status.inc +++ b/inc/status.inc @@ -214,8 +214,12 @@ STATUS(){ [ "${NTYPE}" != "OFW" ] && srvctst=(`${NCMD} "systemctl is-active ${srvcstotest}"`) sr=0 for srvc in "${!srvcs}"; do - [ "${srvc}" == "gitea" ] && [ "${NTYPE}" == "WEB" ] && [[ $(${NCMD} ip addr show $(ip route | awk '/default/ { print $5 }') | grep "inet" | awk '/inet/ {print $2}' | cut -d'/' -f1) != *${NM_SINGLESRVR_IP['WEB']}* ]] && NOGOCHK=false || NOGOCHK=true - [ "${srvc}" == "headscale" ] && [ "${NTYPE}" == "HS" ] && [[ $(${NCMD} ip addr show $(ip route | awk '/default/ { print $5 }') | grep "inet" | awk '/inet/ {print $2}' | cut -d'/' -f1) != *${NM_SINGLESRVR_IP['HS']}* ]] && NOGOCHK=false + if [ "${srvc}" == "gitea" ] && [ "${NTYPE}" == "WEB" ] && [[ $(${NCMD} ip addr show $(ip route | awk '/default/ { print $5 }') | grep "inet" | awk '/inet/ {print $2}' | cut -d'/' -f1) != *${NM_SINGLESRVR_IP['WEB']}* ]]; then + NOGOCHK=false + rm -f ${NM_TMPFOLDER}/${nip}~${srvc}.* + else + NOGOCHK=true + fi [ "${srvc}" == "keepalived" ] && ([ "${nip}" == "10.2.1.2" ] || [ "${nip}" == "10.2.1.51" ]) && NOGOCHK=false if [ ${NOGOCHK} == true ]; then if [ "${ST_ACTION}" != "check" ]; then @@ -298,9 +302,19 @@ STATUS(){ fi for docker in "${!dockers}"; do if [ "${NTYPE}" == "WEB" ]; then - ([ "${docker}" == "vaultwarden" ] || [ "${docker}" == "heimdall" ]) && [[ $(${NCMD} ip addr show $(ip route | awk '/default/ { print $5 }') | grep "inet" | awk '/inet/ {print $2}' | cut -d'/' -f1) != *${NM_SINGLESRVR_IP['WEB']}* ]] && NOGOCHK=false || NOGOCHK=true + if ([ "${docker}" == "vaultwarden" ] || [ "${docker}" == "heimdall" ]) && [[ $(${NCMD} ip addr show $(ip route | awk '/default/ { print $5 }') | grep "inet" | awk '/inet/ {print $2}' | cut -d'/' -f1) != *${NM_SINGLESRVR_IP['WEB']}* ]]; then + NOGOCHK=false + rm -f ${NM_TMPFOLDER}/${nip}~${docker}.* + else + NOGOCHK=true + fi elif [ "${NTYPE}" == "LB" ]; then - [ "${docker}" == "authelia" ] && [[ $(${NCMD} ip addr show $(ip route | awk '/default/ { print $5 }') | grep "inet" | awk '/inet/ {print $2}' | cut -d'/' -f1) != *${NM_SINGLESRVR_IP['LB']}* ]] && NOGOCHK=false || NOGOCHK=true + if [ "${docker}" == "authelia" ] && [[ $(${NCMD} ip addr show $(ip route | awk '/default/ { print $5 }') | grep "inet" | awk '/inet/ {print $2}' | cut -d'/' -f1) != *${NM_SINGLESRVR_IP['LB']}* ]]; then + NOGOCHK=false + rm -f ${NM_TMPFOLDER}/${nip}~${docker}.* + else + NOGOCHK=true + fi else NOGOCHK=true fi