This commit is contained in:
2025-06-11 23:26:28 -05:00
parent 74a0f81c0f
commit ea69a6d84b
2 changed files with 25 additions and 25 deletions

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash
VERS='5.5.19-06112025'
VERS='5.5.18-06112025'
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 '

View File

@@ -17,7 +17,30 @@ SINGLE_SERVER_SERVICE_CHECK(){
# rm -f ${NM_TMPFOLDER}/.singleserver*
if [ ! -f ${NM_TMPFOLDER}/.skip ] && ([[ "$(declare -p ${1^^}_SINGLESRVR_SERVICES)" =~ "declare -a" ]] || [[ "$(declare -p ${1^^}_SINGLESRVR_DOCKERS)" =~ "declare -a" ]] || [ "${1^^}" == "LPD" ]); then
if [[ $(ip addr show $(ip route | awk '/default/ { print $5 }') | grep "inet" | awk '/inet/ {print $2}' | cut -d'/' -f1) == *${NM_SINGLESRVR_IP[${1^^}]}* ]]; then
if [ "${1^^}" == "LPD" ]; then
dnstest=$(dig +short www.google.com @127.0.0.1)
if [ "${dnstest}" == "" ]; then
/usr/local/bin/nmg skip on >/dev/null 2>&1
completed=false; scanstart=$(date +%s)
sleep 4s
until [ "${completed}" == "true" ]; do
dnstest=$(dig +short www.google.com @127.0.0.1)
if [ "${dnstest}" != "" ]; then
completed=true
break
elif [ $(($(date +%s)-scanstart)) -ge 1200 ]; then
SENDNOTICE "${NM_HOSTNAMES[${RUN_NODE_IP}]} DNS Startup Failure" "${NM_HOSTNAMES[${RUN_NODE_IP}]} (${RUN_NODE_IP})
Server did not start serving DNS requests within 20mins you moron...." 1
killall bash
exit 1
fi
sleep 15s
done
/usr/local/bin/nmg skip off >/dev/null 2>&1
fi
elif [[ $(ip addr show $(ip route | awk '/default/ { print $5 }') | grep "inet" | awk '/inet/ {print $2}' | cut -d'/' -f1) == *${NM_SINGLESRVR_IP[${1^^}]}* ]]; then
# if [ ! -f ${NM_TMPFOLDER}/.singleserver.${1^^}.primary ] || [ $(expr $(date +%s) - $(stat -c %Y ${NM_TMPFOLDER}/.singleserver.${1^^}.primary)) -ge 300 ]; then
# if [ ! -f ${NM_TMPFOLDER}/.singleserver.${1^^}.primary ]; then
if [ ! -f ${NM_TMPFOLDER}/.singleserver.${1^^}.primary ]; then
@@ -63,29 +86,6 @@ SINGLE_SERVER_SERVICE_CHECK(){
echo "$(date +%Y-%m-%d-%H-%M-%S) - ${NM_HOSTNAMES[${RUN_NODE_IP}]} - ... Done" >> ${NM_LOGFILE}
# fi
if [ "${1^^}" == "LPD" ]; then
dnstest=$(dig +short www.google.com @127.0.0.1)
if [ "${dnstest}" == "" ]; then
/usr/local/bin/nmg skip on >/dev/null 2>&1
completed=false; scanstart=$(date +%s)
sleep 4s
until [ "${completed}" == "true" ]; do
dnstest=$(dig +short www.google.com @127.0.0.1)
if [ "${dnstest}" != "" ]; then
completed=true
break
elif [ $(($(date +%s)-scanstart)) -ge 1200 ]; then
SENDNOTICE "${NM_HOSTNAMES[${RUN_NODE_IP}]} DNS Startup Failure" "${NM_HOSTNAMES[${RUN_NODE_IP}]} (${RUN_NODE_IP})
Server did not start serving DNS requests within 20mins you moron...." 1
killall bash
exit 1
fi
sleep 15s
done
/usr/local/bin/nmg skip off >/dev/null 2>&1
fi
fi
else
# if [ -f ${NM_TMPFOLDER}/.singleserver.${1^^}.primary ] || [ ! -f ${NM_TMPFOLDER}/.singleserver.${1^^}.secondary ] || [ $(expr $(date +%s) - $(stat -c %Y ${NM_TMPFOLDER}/.singleserver.${1^^}.secondary)) -ge 300 ]; then