Update services.inc
This commit is contained in:
@@ -8,9 +8,9 @@ SINGLE_SERVER_SERVICE_CHECK(){
|
||||
if [ "${!servicestocheck}" != "" ] || [ "${!dockerstocheck}" != "" ]; then
|
||||
local_ips=$(ip addr show $(ip route | awk '/default/ { print $5 }') | grep "inet" | awk '/inet/ {print $2}' | cut -d'/' -f1);
|
||||
local_ip=$(/sbin/ip -o -4 addr list eth0 |grep 255 | awk '{print $4}' | cut -d/ -f1)
|
||||
if [[ ${local_ips} = *10.10.1.120* ]]; then
|
||||
if [[ ${local_ips} == *${NM_SINGLESRVR_IP[${1^^}]}* ]]; then
|
||||
if [ ! -f ${NM_TMPFOLDER}/.singleserver ]; then
|
||||
SENDNOTICE "Node-Balancing Notice" "Starting SingleServer Services on ${NM_NODETYPES["WEB"]}-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
|
||||
fi
|
||||
if [ ! -f /mnt/web-data/mounted ]; then
|
||||
@@ -20,7 +20,7 @@ SINGLE_SERVER_SERVICE_CHECK(){
|
||||
if [ -f ${NM_REPL_CHECK_LOC["${1}-data"]}/mounted ]; then
|
||||
for stc in "${!servicestocheck}"; do
|
||||
if [ "$(systemctl is-active ${stc}.service)" != "active" ]; then
|
||||
echo "$(date) - ${NM_NODETYPES["WEB"]}-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"
|
||||
for nip in "${!hosts}"; do
|
||||
@@ -236,7 +236,7 @@ SERVICE(){
|
||||
${PH_CMD} rm -f ${NM_REPL_NGINX_PATHS[${RUN_NODE_TYPE}]}/test.repl
|
||||
fi
|
||||
fi
|
||||
elif ([ "${1}" = "pdns" ] || [ "${1}" = "pdnsadmin" ]) && ([ "${3}" == "" ] || [ "${3}" == "all" ]); then
|
||||
elif ([ "${1}" = "pdns" ] || [ "${1}" = "pdnsadmin" ] || [ "${1}" = "headscale" ]) && ([ "${3}" == "" ] || [ "${3}" == "all" ]); then
|
||||
if [ "${2}" = "start" ] || [ "${2}" = "restart" ] || [ "${2}" = "reload" ]; then
|
||||
if [ "${3}" != "ns" ]; then
|
||||
if [ "${3}" != "q" ]; then
|
||||
|
||||
Reference in New Issue
Block a user