From 8c5b2227a34b5755f667af733a9eae5b7bc68387 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Wed, 15 Nov 2023 22:18:05 -0600 Subject: [PATCH] update --- defaults.inc | 10 +++++----- inc/certs.inc | 17 ++--------------- inc/services.inc | 16 +++++++--------- inc/sites.inc | 2 +- inc/status.inc | 20 ++++++++++---------- nodemgmt-scripts.sh | 22 +++++++++++----------- 6 files changed, 36 insertions(+), 51 deletions(-) diff --git a/defaults.inc b/defaults.inc index 29fb70b7..48a2f2d4 100755 --- a/defaults.inc +++ b/defaults.inc @@ -1,5 +1,5 @@ #!/usr/bin/env bash -VERS='4.14.14-11152023' +VERS='4.14.20-11152023' 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' @@ -114,7 +114,7 @@ NM_LOGFILE=${NM_LOGFOLDER}/logfile NM_WANDNS='wdns.scity.us' NM_LANDNS='ldns.scity.us' -TSI=$(/sbin/ip link | grep tailscale0) && [ ${#TSI} != 0 ] && RUN_NODE_TSIP=$(/sbin/ip -o -4 addr list tailscale0 | awk '{print $4}' | cut -d/ -f1) || RUN_NODE_TSIP= +TSI=$(ip link | grep tailscale0) && [ ${#TSI} != 0 ] && RUN_NODE_TSIP=$(ip -o -4 addr list tailscale0 | awk '{print $4}' | cut -d/ -f1) || RUN_NODE_TSIP= [ "$(ip route | awk '/default/ { print $5 }')" == "link" ] && RNIP=$(ip addr show $(ip route | awk '/1 dev eth0/ { print $5 }') | grep "inet" | head -n 1 | awk '/inet/ {print $2}' | cut -d'/' -f1) || RNIP=$(ip addr show $(ip route | awk '/default/ { print $5 }') | grep "inet" | head -n 1 | awk '/inet/ {print $2}' | cut -d'/' -f1) @@ -126,10 +126,10 @@ else var=${NTYPE}_HOSTS[@] RUN_NODE_TYPE="" for nip in "${!var}"; do - # echo "${NTYPE} - $nip - ${RNIP} - ${RUN_NODE_TSIP}" - if [[ "${RNIP}" == *"${nip}"* ]]; then + # echo "${NTYPE} - $nip - ${RUN_NODE_IP} - ${RUN_NODE_TSIP}" + if [[ "${RUN_NODE_IP}" == *"${nip}"* ]]; then RUN_NODE_TYPE=${NTYPE}; - RUN_NODE_IP=${RNIP} + RUN_NODE_IP=${RUN_NODE_IP} break 2 elif [[ "${RUN_NODE_TSIP}" == *"${nip}"* ]]; then RUN_NODE_TYPE=${NTYPE}; diff --git a/inc/certs.inc b/inc/certs.inc index b3f7ae8b..a64314a6 100755 --- a/inc/certs.inc +++ b/inc/certs.inc @@ -126,9 +126,6 @@ DEL-SSL(){ } CERTRENEW(){ - # echo -en "${idsCL[LightCyan]}Stopping Webserver-Node2...${idsCL[Default]}" - # ssh root@webserver-node2.scity.us service nginx stop - # echo -e "${idsCL[LightGreen]} Completed${idsCL[Default]}" echo echo -e "${idsCL[LightGreen]}Renewing Certificates...${idsCL[Default]}" echo @@ -144,9 +141,6 @@ CERTRENEW(){ daterun=`date +%Y-%m-%d-%H-%M-%S` echo -e "${daterun}" >> ${NM_LOGFOLDER}/cert-renewal.lastrun DIVIDER true - # echo -en "${idsCL[LightCyan]}Starting Webserver-Node2 Back up...${idsCL[Default]}" - # ssh root@webserver-node2.scity.us service nginx start - # echo -e "${idsCL[LightGreen]} Completed${idsCL[Default]}" echo SERVICE nginx reload >> ${NM_LOGFOLDER}/cert-renewal.lastrun echo -e "${idsCL[LightGreen]}The certificates have been renewed.${idsCL[Default]}" @@ -157,9 +151,6 @@ CERTRENEW(){ fi } NIGHTLYRENEW(){ - # rm -f ${NM_LOGFOLDER}/cert-renewal.lastrun - # ssh root@webserver-node2.scity.us service nginx stop - # sleep 5 $CERT_DAEMON renew --webroot -w ${NM_CERTPATH}/letsencrypt-acme-challenge CONCAT_SSL chown -R root:le ${NM_CERTPATH} @@ -410,16 +401,12 @@ LISTCERTS(){ checkcerts_sorted=$(sort <<< "$(cat ${NM_FOLDER}/conf/ssl-domain-checks.conf)") rm -f ${NM_FOLDER}/conf/ssl-domain-checks.conf >/dev/null 2&>1 echo "${checkcerts_sorted}" > ${NM_FOLDER}/conf/ssl-domain-checks.conf - if [ "${NM_NODEMANAGER}" != "$(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1 | head -n1)" ]; then - scp -q ${NM_FOLDER}/conf/ssl-domain-checks.conf root@${NM_NODEMANAGER}:${NM_FOLDER}/conf/ssl-domain-checks.conf - fi + [ "${RUN_NODE_TYPE}" != "NM" ] && scp -q ${NM_FOLDER}/conf/ssl-domain-checks.conf root@${NM_NODEMANAGER}:${NM_FOLDER}/conf/ssl-domain-checks.conf fi else sed -i "/${SUBJECT}/d" ${NM_FOLDER}/conf/ssl-domain-checks.conf >/dev/null 2&>1 - if [ "${NM_NODEMANAGER}" != "$(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1 | head -n1)" ]; then - scp -q ${NM_FOLDER}/conf/ssl-domain-checks.conf root@${NM_NODEMANAGER}:${NM_FOLDER}/conf/ssl-domain-checks.conf - fi + [ "${RUN_NODE_TYPE}" != "NM" ] && scp -q ${NM_FOLDER}/conf/ssl-domain-checks.conf root@${NM_NODEMANAGER}:${NM_FOLDER}/conf/ssl-domain-checks.conf fi echo -e "${idsCL[LightGreen]}Done${idsCL[Default]}" echo diff --git a/inc/services.inc b/inc/services.inc index bb107fa6..9ed20dd2 100755 --- a/inc/services.inc +++ b/inc/services.inc @@ -6,11 +6,9 @@ SINGLE_SERVER_SERVICE_CHECK(){ hosts=${1^^}_HOSTS[@] 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} == *${NM_SINGLESRVR_IP[${1^^}]}* ]]; then + 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_NODETYPES[${1^^}]}-Node${local_ip: -1} (${local_ip}), stopping on other Nodes" + SENDNOTICE "Node-Balancing Notice" "Starting SingleServer Services on ${NM_HOSTNAMES[${RUN_NODE_IP}]} (${RUN_NODE_IP}), stopping on other Nodes" touch ${NM_TMPFOLDER}/.singleserver fi gofor=false @@ -24,11 +22,11 @@ SINGLE_SERVER_SERVICE_CHECK(){ if [ "${gofor}" == "true" ]; then for stc in "${!servicestocheck}"; do 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_HOSTNAMES[${RUN_NODE_IP}]} - Starting ${stc} on ${RUN_NODE_IP}, stopping on the other Nodes ..." >> ${NM_LOGFILE} [ "${stc}" = "pdnsadmin" ] && stc="pdnsadmin.service pdnsadmin.socket" for nip in "${!hosts}"; do - if [[ "${local_ip}" != *"${nip}"* ]] && [ "$(CHECK_HOST ${nip})" != "false" ]; then + if [[ "${RUN_NODE_IP}" != *"${nip}"* ]] && [ "$(CHECK_HOST ${nip})" != "false" ]; then ssh -tq root@${nip} /bin/systemctl stop ${stc} ssh -tq root@${nip} rm -f ${NM_TMPFOLDER}/.singleserver fi @@ -37,12 +35,12 @@ SINGLE_SERVER_SERVICE_CHECK(){ [ "${stc}" = "pdnsadmin" ] && stc="pdnsadmin.socket pdnsadmin.service" [ "${stc}" = "headscale" ] && sleep 90s /bin/systemctl start ${stc} & - echo "$(date) - ${NM_NODETYPES[${1^^}]}-Node${local_ip: -1} - ... Done" >> ${NM_LOGFILE} + echo "$(date) - ${NM_HOSTNAMES[${RUN_NODE_IP}]} - ... Done" >> ${NM_LOGFILE} fi done for docker in "${!dockerstocheck}"; do for nip in "${!hosts}"; do - if [[ "${local_ip}" = *"${nip}"* ]]; then + if [[ "${RUN_NODE_IP}" = *"${nip}"* ]]; then if [ "docker ps -a | grep ${docker})" ]; then [ "${docker}" == "authelia" ] && [ ! "$(/usr/bin/docker ps -q -f name=auth_redis)" ] && /usr/bin/docker start auth_redis && sleep 2s >/dev/null 2>&1 [ ! "$(/usr/bin/docker ps -q -f name=${docker})" ] && /usr/bin/docker start ${docker} & >/dev/null 2>&1 @@ -81,7 +79,7 @@ SINGLE_SERVER_SERVICE_CHECK(){ fi if [ "$(systemctl is-active nginx)" != "active" ]; then - ${NM_SCRIPT} service web restart ${local_ip} + ${NM_SCRIPT} service web restart ${RUN_NODE_IP} fi fi } diff --git a/inc/sites.inc b/inc/sites.inc index c95eb5d9..836d1669 100755 --- a/inc/sites.inc +++ b/inc/sites.inc @@ -546,7 +546,7 @@ SITEINFO(){ done if [ "${onefacline}" == "" ]; then - [ "$($NCMD /sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1 | head -n1)" != "${NM_AUTHELIA_IP}" ] && ACMD="ssh root@${NM_AUTHELIA_IP}" || ACMD="" + [ "$($NCMD ip addr show $(ip route | awk '/default/ { print $5 }') | grep "inet" | head -n 1 | awk '/inet/ {print $2}' | cut -d'/' -f1)" != "${NM_AUTHELIA_IP}" ] && ACMD="ssh root@${NM_AUTHELIA_IP}" || ACMD="" autheliaconfig=$(${ACMD} cat ${NM_DOCKER_COMPOSE_LOC['authelia']}/config/configuration.yml) onefacline=$(echo "${autheliaconfig}" | grep -Fn one_factor | sort | tail -n1) onefacline=${onefacline%%:*} diff --git a/inc/status.inc b/inc/status.inc index 736fe9e2..d061a2f4 100755 --- a/inc/status.inc +++ b/inc/status.inc @@ -40,7 +40,7 @@ STATUS(){ if [ "${ST_ACTION}" = "" ] || [ "${ST_ACTION}" = "report" ] || [ "${ST_ACTION}" = "services" ] || [ "${ST_ACTION}" = "dockers" ] || [ "${ST_ACTION}" = "check" ]; then if [ ! -z ${LOCAL_SERVICES+x} ] && [ "${ST_ACTION}" != "dockers" ]; then if [ "${ST_ACTION}" != "check" ]; then - lip=$(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1 | head -n1) + lip=${RUN_NODE_IP} echo -e "\n$(DIVIDER)\n${idsCL[Yellow]}${idsST[Bold]} LOCALHOST Service Status${idsST[Reset]}${idsCL[Default]}" echo -e "$(DIVIDER)\n" echo -en " ${idsST[Bold]}${idsCL[LightCyan]}${NODE_HOSTNAME} (${lip})${idsST[Reset]}" @@ -53,7 +53,7 @@ STATUS(){ DIVIDER . green fi # if [ "${ST_ACTION}" != "check" ]; then - # lip=$(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1 | head -n1) + # lip=${RUN_NODE_IP} # uptime=`uptime -p` # echo -e " ${idsST[Bold]}${idsCL[LightCyan]}${NODE_HOSTNAME} (${lip})${idsST[Reset]}${idsCL[LightCyan]} - ${uptime} - localhost${idsCL[Default]}" # DIVIDER false green @@ -141,7 +141,7 @@ STATUS(){ for nip in "${!var}"; do [ "${ST_ACTION}" != "check" ] && echo -en " ${idsST[Bold]}${idsCL[LightCyan]}${NM_HOSTNAMES[${nip}]} [${nip}]${idsST[Reset]}" - if [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1 | head -n1) == *"${nip}"* ]]; then + if [[ "${RUN_NODE_IP}" == *"${nip}"* ]]; then NCMD=''; LH='- localhost' else NCMD="ssh root@${nip}"; LH='' @@ -188,8 +188,8 @@ STATUS(){ [ "${NTYPE}" != "OFW" ] && srvctst=(`${NCMD} "systemctl is-active ${srvcstotest}"`) sr=0 for srvc in "${!srvcs}"; do - [ "${srvc}" == "gitea" ] && [ "${NTYPE}" == "WEB" ] && [[ $($NCMD /sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1 | head -n1) != *${NM_AUTHELIA_IP}* ]] && NOGOCHK=false || NOGOCHK=true - [ "${srvc}" == "headscale" ] && [ "${NTYPE}" == "HS" ] && [[ $($NCMD /sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1 | head -n1) != *${NM_SINGLESRVR_IP['HS']}* ]] && NOGOCHK=false + [ "${srvc}" == "gitea" ] && [ "${NTYPE}" == "WEB" ] && [[ $($NCMD ip addr show $(ip route | awk '/default/ { print $5 }') | grep "inet" | head -n 1 | awk '/inet/ {print $2}' | cut -d'/' -f1) != *${NM_AUTHELIA_IP}* ]] && NOGOCHK=false || NOGOCHK=true + [ "${srvc}" == "headscale" ] && [ "${NTYPE}" == "HS" ] && [[ $($NCMD ip addr show $(ip route | awk '/default/ { print $5 }') | grep "inet" | head -n 1 | awk '/inet/ {print $2}' | cut -d'/' -f1) != *${NM_SINGLESRVR_IP['HS']}* ]] && NOGOCHK=false [ "${srvc}" == "keepalived" ] && ([ "${nip}" == "10.2.1.2" ] || [ "${nip}" == "10.2.1.51" ]) && NOGOCHK=false if [ ${NOGOCHK} == true ]; then if [ "${ST_ACTION}" != "check" ]; then @@ -265,7 +265,7 @@ STATUS(){ # for srvc in "${!var2}"; do # NOGOCHK=true; - # [ "${srvc}" == "gitea" ] && [ "${NTYPE}" == "WEB" ] && [[ $($NCMD /sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1 | head -n1) != *${WEB_HOSTS[0]}* ]] && NOGOCHK=false; + # [ "${srvc}" == "gitea" ] && [ "${NTYPE}" == "WEB" ] && [[ $($NCMD ip addr show $(ip route | awk '/default/ { print $5 }') | grep "inet" | head -n 1 | awk '/inet/ {print $2}' | cut -d'/' -f1) != *${WEB_HOSTS[0]}* ]] && NOGOCHK=false; # if [ ${NOGOCHK} = true ]; then # if [ "${ST_ACTION}" != "check" ]; then # if [ "${ST_ACTION}" != "report" ]; then @@ -352,7 +352,7 @@ STATUS(){ fi for docker in "${!dockers}"; do if [ "${NTYPE}" == "WEB" ]; then - ([ "${docker}" == "vaultwarden" ] || [ "${docker}" == "heimdall" ] || [ "${docker}" == "authelia" ]) && [[ $($NCMD /sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1 | head -n1) != *${NM_AUTHELIA_IP}* ]] && NOGOCHK=false || NOGOCHK=true + ([ "${docker}" == "vaultwarden" ] || [ "${docker}" == "heimdall" ] || [ "${docker}" == "authelia" ]) && [[ $($NCMD ip addr show $(ip route | awk '/default/ { print $5 }') | grep "inet" | head -n 1 | awk '/inet/ {print $2}' | cut -d'/' -f1) != *${NM_AUTHELIA_IP}* ]] && NOGOCHK=false || NOGOCHK=true else NOGOCHK=true fi @@ -477,7 +477,7 @@ STATUS(){ if [ ! -z ${!var+x} ]; then var=${NTYPE}_HOSTS[@] for nip in "${!var}"; do - if [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1 | head -n1) != *"${nip}"* ]] && [ "${nip}" != "${!PH}" ]; then + if [[ "${RUN_NODE_IP}" != *"${nip}"* ]] && [ "${nip}" != "${!PH}" ]; then if [ ! -f ${NM_FOLDER}/${!PH}.down ] && [ ! -f ${NM_TMPFOLDER}/${nip}.down ]; then var2=${NTYPE}_REPL_CHECK[@] for rcheck in "${!var2}"; do @@ -497,7 +497,7 @@ STATUS(){ if [ ! -z ${!var+x} ]; then var=${NTYPE}_HOSTS[@] for nip in "${!var}"; do - if [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1 | head -n1) != *"${nip}"* ]] && [ "${nip}" != "${!PH}" ]; then + if [[ "${RUN_NODE_IP}" != *"${nip}"* ]] && [ "${nip}" != "${!PH}" ]; then if [ "${ST_ACTION}" != "check" ]; then echo -e " ${idsCL[LightCyan]}${NM_HOSTNAMES[${!PH}]} (${!PH}) <--> ${idsST[Bold]}${NM_HOSTNAMES[${nip}]}[${nip}]${idsST[Reset]}${idsCL[Default]}" DIVIDER false green @@ -623,7 +623,7 @@ It was down for $(SHOW_TIME ${toterrtime})" nid=1 var=${NTYPE}_HOSTS[@] for nip in "${!var}"; do - if [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1 | head -n1) == *"${nip}"* ]]; then NCMD=''; LH='- localhost' + if [[ $"{RNIP}" == *"${nip}"* ]]; then NCMD=''; LH='- localhost' else NCMD="ssh root@${nip}"; LH='' fi if [ "${ST_ACTION}" != "check" ]; then diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index b1837a79..2e87a24a 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -63,7 +63,7 @@ SET-PERMISSIONS(){ NCMD="ssh root@${nip}" fi if [ "${2}" != "q" ]; then - echo -en "${idsCL[Yellow]}Resetting folder permissions for Gitea on Webserver-Node${nid} (${nip})... ${idsCL[Default]}" + echo -en "${idsCL[Yellow]}Resetting folder permissions for Gitea on ${NM_HOSTNAMES[${nip}]} (${nip})... ${idsCL[Default]}" fi checkhost=$(CHECK_HOST ${nip}) if [ "${checkhost}" != "false" ]; then @@ -88,7 +88,7 @@ SET-PERMISSIONS(){ NCMD="ssh root@${nip}" fi if [ "${2}" != "q" ]; then - echo -en "${idsCL[Yellow]}Resetting folder permissions for PowerDNS-Admin on Webserver-Node${nid} (${nip})... ${idsCL[Default]}" + echo -en "${idsCL[Yellow]}Resetting folder permissions for PowerDNS-Admin on ${NM_HOSTNAMES[${nip}]} (${nip})... ${idsCL[Default]}" fi checkhost=$(CHECK_HOST ${nip}) if [ "${checkhost}" != "false" ]; then @@ -110,7 +110,7 @@ SET-PERMISSIONS(){ NCMD="ssh root@${nip}" fi if [ "${2}" != "q" ]; then - echo -en "${idsCL[Yellow]}Resetting folder permissions for Nextcloud on Nextcloud-Node1 (${nip})... ${idsCL[Default]}" + echo -en "${idsCL[Yellow]}Resetting folder permissions for Nextcloud on ${NM_HOSTNAMES[${nip}]} (${nip})... ${idsCL[Default]}" fi checkhost=$(CHECK_HOST ${nip}) if [ "${checkhost}" != "false" ]; then @@ -140,7 +140,7 @@ SET-PERMISSIONS(){ else NCMD="ssh root@${nip}" fi - echo -e "${idsCL[Yellow]}Setting folder permissions for MySQL-Node${nid} (${nip})${idsCL[Default]}" + echo -e "${idsCL[Yellow]}Setting folder permissions for ${NM_HOSTNAMES[${nip}]} (${nip})${idsCL[Default]}" echo -en "${idsCL[Cyan]}LetsEncrypt Certs ${idsCL[Default]}" ${NCMD} chown -R root:le ${NM_CERTPATH} ${NCMD} chmod -R 6775 ${NM_CERTPATH} @@ -162,14 +162,14 @@ SET-PERMISSIONS(){ NCMD="ssh root@${nip}" fi if [ "${NEW_SITE}" != "" ]; then - echo -en "${idsCL[Cyan]}Webserver-Node${nid} (${nip}) ${idsCL[Default]}" + echo -en "${idsCL[Cyan]}${NM_HOSTNAMES[${nip}]} (${nip}) ${idsCL[Default]}" ${NCMD} chown -R www-data:www-data ${WWWPATH}/$NEW_SITE ${NCMD} chmod -R 7775 ${WWWPATH}/$NEW_SITE ${NCMD} chown -R www-data:www-data /var/lib/php/sessions ${NCMD} chmod -R 7777 /var/lib/php/sessions echo -e "${idsCL[Green]}Complete${idsCL[Default]}" else - echo -e "${idsCL[Yellow]}Setting folder permissions for Webserver-Node${nid} (${nip})${idsCL[Default]}" + echo -e "${idsCL[Yellow]}Setting folder permissions for ${NM_HOSTNAMES[${nip}]} (${nip})${idsCL[Default]}" echo -en "${idsCL[Cyan]}Webserver folders ${idsCL[Default]}" ${NCMD} chown -R www-data:www-data ${WWWPATH} ${NCMD} chmod -R 7775 ${WWWPATH} @@ -207,7 +207,7 @@ HAPROXY-CONFIG() { else NCMD="ssh root@${nip}" fi - echo -en "Creating File on MySQL-Node${nid} ($nip)... ${idsCL[Default]}" + echo -en "Creating File on ${NM_HOSTNAMES[${nip}]} ($nip)... ${idsCL[Default]}" ${NCMD} "nodemgmt update q" ${NCMD} "rm -f /etc/haproxy/haproxy.cfg" @@ -228,7 +228,7 @@ HAPROXY-CONFIG() { else NCMD="ssh root@${nip}" fi - echo -en "Creating File on Webserver-Node${nid} ($nip)... ${idsCL[Default]}" + echo -en "Creating File on ${NM_HOSTNAMES[${nip}]} ($nip)... ${idsCL[Default]}" ${NCMD} "nodemgmt update q" ${NCMD} "rm -f /etc/haproxy/haproxy.cfg" @@ -248,7 +248,7 @@ HAPROXY-CONFIG() { else NCMD="ssh root@${nip}" fi - echo -en "Creating File on LB-Node${nid} ($nip)... ${idsCL[Default]}" + echo -en "Creating File on ${NM_HOSTNAMES[${nip}]} ($nip)... ${idsCL[Default]}" ${NCMD} "nodemgmt update q" ${NCMD} "rm -f /etc/haproxy/haproxy.cfg" @@ -278,7 +278,7 @@ KEEPALIVE-CONFIG() { else NCMD="ssh root@${nip}" fi - echo -en "Creating File on MySQL-Node${nid} ($nip)... ${idsCL[Default]}" + echo -en "Creating File on ${NM_HOSTNAMES[${nip}]} ($nip)... ${idsCL[Default]}" ${NCMD} "nodemgmt update q" ${NCMD} "rm -f /etc/keepalived/keepalived.conf" @@ -299,7 +299,7 @@ KEEPALIVE-CONFIG() { else NCMD="ssh root@${nip}" fi - echo -en "Creating File on Webserver-Node${nid} ($nip)... ${idsCL[Default]}" + echo -en "Creating File on ${NM_HOSTNAMES[${nip}]} ($nip)... ${idsCL[Default]}" ${NCMD} "nodemgmt update q" ${NCMD} "rm -f /etc/keepalived/keepalived.conf"