Update services.inc

This commit is contained in:
2025-06-11 23:22:24 -05:00
parent c7fd86be6b
commit 74a0f81c0f

View File

@@ -16,7 +16,7 @@ SINGLE_SERVER_SERVICE_CHECK(){
# rm -f ${NM_TMPFOLDER}/.singleserver* # rm -f ${NM_TMPFOLDER}/.singleserver*
if [ ! -f ${NM_TMPFOLDER}/.skip ] && ([[ "$(declare -p ${1^^}_SINGLESRVR_SERVICES)" =~ "declare -a" ]] || [[ "$(declare -p ${1^^}_SINGLESRVR_DOCKERS)" =~ "declare -a" ]]); then 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 [[ $(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 ] || [ $(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
@@ -64,23 +64,27 @@ SINGLE_SERVER_SERVICE_CHECK(){
# fi # fi
if [ "${1^^}" == "LPD" ]; then if [ "${1^^}" == "LPD" ]; then
/usr/local/bin/nmg skip on >/dev/null 2>&1 dnstest=$(dig +short www.google.com @127.0.0.1)
completed=false; scanstart=$(date +%s) if [ "${dnstest}" == "" ]; then
until [ "${completed}" == "true" ]; do /usr/local/bin/nmg skip on >/dev/null 2>&1
dnstest=$(dig +short www.google.com @127.0.0.1) completed=false; scanstart=$(date +%s)
if [ "${dnstest}" != "" ]; then sleep 4s
completed=true until [ "${completed}" == "true" ]; do
break dnstest=$(dig +short www.google.com @127.0.0.1)
if [ "${dnstest}" != "" ]; then
completed=true
break
elif [ $(($(date +%s)-scanstart)) -gt 1200 ]; then elif [ $(($(date +%s)-scanstart)) -ge 1200 ]; then
SENDNOTICE "${NM_HOSTNAMES[${RUN_NODE_IP}]} DNS Startup Failure" "${NM_HOSTNAMES[${RUN_NODE_IP}]} (${RUN_NODE_IP}) 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 Server did not start serving DNS requests within 20mins you moron...." 1
killall bash killall bash
exit 1 exit 1
fi fi
sleep 15s sleep 15s
done done
/usr/local/bin/nmg skip off >/dev/null 2>&1 /usr/local/bin/nmg skip off >/dev/null 2>&1
fi
fi fi
else else