Update nodemgmt-scripts.sh

This commit is contained in:
2023-06-23 22:48:20 -05:00
parent c7de73c522
commit cc74672c12

View File

@@ -739,9 +739,9 @@ SINGLE_SERVER_SERVICE_CHECK(){
/bin/mount -a
sleep 5s
fi
if [ -f /mnt/web-data/mounted ]; then
if [ -f ${REPL_CHECKS["${1}-data"]}/mounted ]; then
echo mounted
for stc in "${!servicestocheck}"; do
echo "stc: $stc"
if [ "$(systemctl is-active ${stc}.service)" != "active" ]; then
SENDNOTICE "Node-Balancing Notice" "Starting ${stc} on ${NM_NODETYPES["WEB"]}-Node${local_ip: -1} (${local_ip}), stopping on the other Nodes"
echo "$(date) - ${NM_NODETYPES["WEB"]}-Node${local_ip: -1} - Starting ${stc} on ${local_ip}, stopping on the other Nodes" >> ${LOGFILE}
@@ -757,7 +757,6 @@ SINGLE_SERVER_SERVICE_CHECK(){
fi
done
for docker in "${!dockerstocheck}"; do
echo "docker: $docker"
for nip in "${!hosts}"; do
if [[ "${local_ip}" = *"${nip}"* ]]; then
[ ! "$(/usr/bin/docker ps -q -f name=${docker})" ] && /usr/bin/docker start ${docker} & >/dev/null 2>&1
@@ -770,6 +769,7 @@ SINGLE_SERVER_SERVICE_CHECK(){
fi
done
done
else echo not mounted
fi