Update nodemgmt-scripts.sh
This commit is contained in:
@@ -2051,13 +2051,16 @@ SINGLE_SERVER_SERVICE_CHECK(){
|
|||||||
if [ -f /mnt/web-data/mounted ]; then
|
if [ -f /mnt/web-data/mounted ]; then
|
||||||
for stc in "${services_to_check[@]}"; do
|
for stc in "${services_to_check[@]}"; do
|
||||||
if [ "$(systemctl is-active ${stc}.service)" != "active" ]; then
|
if [ "$(systemctl is-active ${stc}.service)" != "active" ]; then
|
||||||
|
if [ "${EMAIL_NOTICE}" != "" ]; then echo -e "Starting ${stc} on ${NM_NODETYPES["WEB"]}-Node${local_ip: -1} (${local_ip}), stopping on the other Nodes" | mail -s "Node-Balancing Notice" ${EMAIL_NOTICE}; fi
|
||||||
|
echo "$(date) - ${NM_NODETYPES["WEB"]}-Node${local_ip: -1} - Starting ${stc} on ${local_ip}, stopping on the other Nodes" >> ${LOGFILE}
|
||||||
|
|
||||||
[ "${stc}" = "pdnsadmin" ] && stc="pdnsadmin.socket pdnsadmin.service"
|
[ "${stc}" = "pdnsadmin" ] && stc="pdnsadmin.socket pdnsadmin.service"
|
||||||
for nip in "${WEB_HOSTS[@]}"; do
|
for nip in "${WEB_HOSTS[@]}"; do
|
||||||
if [[ "${local_ip}" != *"${nip}"* ]]; then
|
if [[ "${local_ip}" != *"${nip}"* ]]; then
|
||||||
echo "stopping ${stc} service on ${nip}"
|
|
||||||
ssh root@${nip} /bin/systemctl stop ${stc}
|
ssh root@${nip} /bin/systemctl stop ${stc}
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
sleep 3s
|
||||||
/bin/systemctl start ${stc} &
|
/bin/systemctl start ${stc} &
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user