This commit is contained in:
2024-11-19 22:20:11 -06:00
parent 4277f25fef
commit 71e02175b6
2 changed files with 23 additions and 19 deletions

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash
VERS='5.3.2b-11192024'
VERS='5.3.2c-11192024'
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

@@ -12,16 +12,18 @@ SINGLE_SERVER_SERVICE_CHECK(){
if [ ! -f ${NM_TMPFOLDER}/.singleserver.${1^^} ]; then
SENDNOTICE "Node-Balancing Notice" "Starting SingleServer Services on ${NM_HOSTNAMES[${RUN_NODE_IP}]} (${RUN_NODE_IP}), stopping on other Nodes"
touch ${NM_TMPFOLDER}/.singleserver.${1^^}
fi
gofor=false
if [ "${1^^}" == "WEBxx" ] && [ ! -f ${NM_REPL_CHECK_LOC['web-data']}/mounted ]; then
/bin/mount -a
sleep 5s
[ -f ${NM_REPL_CHECK_LOC["${1}-data"]}/mounted ] && gofor=true
else
gofor=true
fi
if [ "${gofor}" == "true" ]; then
# fi
# gofor=false
# if [ "${1^^}" == "WEBxx" ] && [ ! -f ${NM_REPL_CHECK_LOC['web-data']}/mounted ]; then
# /bin/mount -a
# sleep 5s
# [ -f ${NM_REPL_CHECK_LOC["${1}-data"]}/mounted ] && gofor=true
# else
# gofor=true
# fi
# if [ "${gofor}" == "true" ]; then
for stc in "${!servicestocheck}"; do
if [ "$(systemctl is-active ${stc}.service)" != "active" ]; then
echo "$(date +%Y-%m-%d-%H-%M-%S) - ${NM_HOSTNAMES[${RUN_NODE_IP}]} - Starting ${stc} on ${RUN_NODE_IP}, stopping on the other Nodes ..." >> ${NM_LOGFILE}
@@ -88,14 +90,16 @@ SINGLE_SERVER_SERVICE_CHECK(){
else
for stc in "${!servicestocheck}"; do
[ "${stc}" = "pdnsadmin" ] && stc="pdnsadmin.socket pdnsadmin.service"
/bin/systemctl stop ${stc} & >/dev/null 2>&1
done
for docker in "${!dockerstocheck}"; do
[ "$(docker ps -q -f name=${docker})" ] && docker stop ${docker} & >/dev/null 2>&1
done
rm -f ${NM_TMPFOLDER}/.singleserver.${1^^}
if [ -f ${NM_TMPFOLDER}/.singleserver.${1^^} ]; then
for stc in "${!servicestocheck}"; do
[ "${stc}" = "pdnsadmin" ] && stc="pdnsadmin.socket pdnsadmin.service"
/bin/systemctl stop ${stc} & >/dev/null 2>&1
done
for docker in "${!dockerstocheck}"; do
[ "$(docker ps -q -f name=${docker})" ] && docker stop ${docker} & >/dev/null 2>&1
done
rm -f ${NM_TMPFOLDER}/.singleserver.${1^^}
fi
[ "${1^^}" == "WEB" ] && [ "$(systemctl is-active nginx)" != "active" ] && ${NM_SCRIPT} service web restart ${RUN_NODE_IP}