From bd768a66332b094e7fdaf4839c087c746bbfa079 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Wed, 29 Nov 2023 10:10:52 -0600 Subject: [PATCH] Update services.inc --- inc/services.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inc/services.inc b/inc/services.inc index 9582619a..033c6fce 100755 --- a/inc/services.inc +++ b/inc/services.inc @@ -7,7 +7,8 @@ SINGLE_SERVER_SERVICE_CHECK(){ [ "${2^^}" == "START" ] && rm -f ${NM_TMPFOLDER}/.singleserver - if [ "${!servicestocheck}" != "" ] || [ "${!dockerstocheck}" != "" ]; then + if [[ "$(declare -p !servicestocheck)" =~ "declare -a" ]] || [ "${!dockerstocheck}" != "" ]; then + echo checking services if [[ $(ip addr show $(ip route | awk '/default/ { print $5 }') | grep "inet" | awk '/inet/ {print $2}' | cut -d'/' -f1) == *${NM_SINGLESRVR_IP[${1^^}]}* ]]; then if [ ! -f ${NM_TMPFOLDER}/.singleserver ]; then SENDNOTICE "Node-Balancing Notice" "Starting SingleServer Services on ${NM_HOSTNAMES[${RUN_NODE_IP}]} (${RUN_NODE_IP}), stopping on other Nodes"