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 #!/usr/bin/env bash
VERS='5.3.2b-11192024' VERS='5.3.2c-11192024'
NM_BETA=false 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 ' 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 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" 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^^} touch ${NM_TMPFOLDER}/.singleserver.${1^^}
fi # fi
gofor=false
if [ "${1^^}" == "WEBxx" ] && [ ! -f ${NM_REPL_CHECK_LOC['web-data']}/mounted ]; then
/bin/mount -a # gofor=false
sleep 5s # if [ "${1^^}" == "WEBxx" ] && [ ! -f ${NM_REPL_CHECK_LOC['web-data']}/mounted ]; then
[ -f ${NM_REPL_CHECK_LOC["${1}-data"]}/mounted ] && gofor=true # /bin/mount -a
else # sleep 5s
gofor=true # [ -f ${NM_REPL_CHECK_LOC["${1}-data"]}/mounted ] && gofor=true
fi # else
if [ "${gofor}" == "true" ]; then # gofor=true
# fi
# if [ "${gofor}" == "true" ]; then
for stc in "${!servicestocheck}"; do for stc in "${!servicestocheck}"; do
if [ "$(systemctl is-active ${stc}.service)" != "active" ]; then 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} 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 else
for stc in "${!servicestocheck}"; do if [ -f ${NM_TMPFOLDER}/.singleserver.${1^^} ]; then
[ "${stc}" = "pdnsadmin" ] && stc="pdnsadmin.socket pdnsadmin.service" for stc in "${!servicestocheck}"; do
/bin/systemctl stop ${stc} & >/dev/null 2>&1 [ "${stc}" = "pdnsadmin" ] && stc="pdnsadmin.socket pdnsadmin.service"
done /bin/systemctl stop ${stc} & >/dev/null 2>&1
for docker in "${!dockerstocheck}"; do done
[ "$(docker ps -q -f name=${docker})" ] && docker stop ${docker} & >/dev/null 2>&1 for docker in "${!dockerstocheck}"; do
done [ "$(docker ps -q -f name=${docker})" ] && docker stop ${docker} & >/dev/null 2>&1
rm -f ${NM_TMPFOLDER}/.singleserver.${1^^} done
rm -f ${NM_TMPFOLDER}/.singleserver.${1^^}
fi fi
[ "${1^^}" == "WEB" ] && [ "$(systemctl is-active nginx)" != "active" ] && ${NM_SCRIPT} service web restart ${RUN_NODE_IP} [ "${1^^}" == "WEB" ] && [ "$(systemctl is-active nginx)" != "active" ] && ${NM_SCRIPT} service web restart ${RUN_NODE_IP}