update
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
VERS='4.12.35-10182023'
|
VERS='4.12.36-10182023'
|
||||||
|
|
||||||
noheader=' service status-check nightlyrephp7.3-fpm,new backup report check checkcerts gitea update-nodes copynpmcerts singleservercheck update-dyndns backup-offsitepfsense gui nightlyreview update '
|
noheader=' service status-check nightlyrephp7.3-fpm,new backup report check checkcerts gitea update-nodes copynpmcerts singleservercheck update-dyndns backup-offsitepfsense gui nightlyreview update '
|
||||||
CERT_DAEMON='/snap/bin/certbot'
|
CERT_DAEMON='/snap/bin/certbot'
|
||||||
|
|||||||
@@ -13,25 +13,28 @@ SINGLE_SERVER_SERVICE_CHECK(){
|
|||||||
SENDNOTICE "Node-Balancing Notice" "Starting SingleServer Services on ${NM_NODETYPES[${1^^}]}-Node${local_ip: -1} (${local_ip}), stopping on other Nodes"
|
SENDNOTICE "Node-Balancing Notice" "Starting SingleServer Services on ${NM_NODETYPES[${1^^}]}-Node${local_ip: -1} (${local_ip}), stopping on other Nodes"
|
||||||
touch ${NM_TMPFOLDER}/.singleserver
|
touch ${NM_TMPFOLDER}/.singleserver
|
||||||
fi
|
fi
|
||||||
|
gofor=false
|
||||||
if [ "${1^^}" == "WEB" ] && [ ! -f /mnt/web-data/mounted ]; then
|
if [ "${1^^}" == "WEB" ] && [ ! -f /mnt/web-data/mounted ]; then
|
||||||
/bin/mount -a
|
/bin/mount -a
|
||||||
sleep 5s
|
sleep 5s
|
||||||
|
[ -f ${NM_REPL_CHECK_LOC["${1}-data"]}/mounted ] && gofor=true
|
||||||
|
else
|
||||||
|
gofor=true
|
||||||
fi
|
fi
|
||||||
if [ -f ${NM_REPL_CHECK_LOC["${1}-data"]}/mounted ]; then
|
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) - ${NM_NODETYPES[${1^^}]}-Node${local_ip: -1} - Starting ${stc} on ${local_ip}, stopping on the other Nodes ..." >> ${NM_LOGFILE}
|
echo "$(date) - ${NM_NODETYPES[${1^^}]}-Node${local_ip: -1} - Starting ${stc} on ${local_ip}, stopping on the other Nodes ..." >> ${NM_LOGFILE}
|
||||||
|
|
||||||
[ "${stc}" = "pdnsadmin" ] && stc="pdnsadmin.socket pdnsadmin.service"
|
[ "${stc}" = "pdnsadmin" ] && stc="pdnsadmin.service pdnsadmin.socket"
|
||||||
for nip in "${!hosts}"; do
|
for nip in "${!hosts}"; do
|
||||||
if [[ "${local_ip}" != *"${nip}"* ]]; then
|
if [[ "${local_ip}" != *"${nip}"* ]] && [ "$(CHECK_HOST ${nip})" != "false" ]; then
|
||||||
if [ "$(CHECK_HOST ${nip})" != "false" ]; then
|
ssh -tq root@${nip} /bin/systemctl stop ${stc}
|
||||||
ssh -tq root@${nip} /bin/systemctl stop ${stc}
|
ssh -tq root@${nip} rm -f ${NM_TMPFOLDER}/.singleserver
|
||||||
ssh -tq root@${nip} rm -f ${NM_TMPFOLDER}/.singleserver
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
sleep 3s
|
sleep 3s
|
||||||
|
[ "${stc}" = "pdnsadmin" ] && stc="pdnsadmin.socket pdnsadmin.service"
|
||||||
/bin/systemctl start ${stc} &
|
/bin/systemctl start ${stc} &
|
||||||
echo "$(date) - ${NM_NODETYPES[${1^^}]}-Node${local_ip: -1} - ... Done" >> ${NM_LOGFILE}
|
echo "$(date) - ${NM_NODETYPES[${1^^}]}-Node${local_ip: -1} - ... Done" >> ${NM_LOGFILE}
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user