From 6718c75d4ae48aaeaa4558209f838cb62b952f4a Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sun, 3 Mar 2019 10:33:01 -0600 Subject: [PATCH] update --- nodemgmt-scripts.sh | 30 ++++++++++++++++++++++++++++++ run.sh | 12 ++++++++---- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index 63d124fe..cb123688 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -1380,6 +1380,36 @@ SERVICE(){ echo "" } +HAPROXY-CONFIG() { + echo -e "${idsCL[LightGreen]}Creating HAProxy Config Files${idsCL[Default]}" + echo -e "${idsCL[LightGreen]}-------------------------------------------${idsCL[Default]}" + + nid=1 + if [[ "${NODESERVICES_CHECK}" = *"${1}"* ]]; then + for nip in "${NODE_HOSTS[@]}"; do + if [[ $(/sbin/ip -o -4 addr list ens192 | awk '{print $4}' | cut -d/ -f1) == *"${nip}"* ]]; then + nip='localhost ' + NCMD='' + else + NCMD="ssh root@${nip}" + fi + echo -en "Creating File on iDS-MySQL${nid} ($nip)... ${idsCL[Default]}" + + ${NCMD} "rm -f /etc/haproxy/haproxy.cfg" + ${NCMD} "sed -e 's;%NIP%;${nip};g' ${FOLDER}/templates/haproxy.config > /etc/haproxy/haproxy.cfg" + + echo -e "${idsCL[Red]}COMPLETE${idsCL[Default]}" + nid=`expr $nid + 1` + done + fi + + SERVICE haproxy reload + + echo "" + echo -e "${idsCL[Green]}${NM_SERVICES[${1}]} has been ${NM_SRVCOPTS[${2}]}ed${idsCL[Default]}" + echo "" +} + GUI(){ DISP_HEADER true true while : diff --git a/run.sh b/run.sh index d2154319..c9350809 100755 --- a/run.sh +++ b/run.sh @@ -15,8 +15,10 @@ if [[ "${noheader}" != *" ${1} "* ]] && [[ "${noheader}" != *" ${2} "* ]]; then DISP_HEADER fi if [ "${1}" != "gui" ]; then - echo -en "${idsCL[LightCyan]}Checking for updates...${idsCL[Default]}" - echo "" + if [ "${1}" != "q" ]; then + echo -en "${idsCL[LightCyan]}Checking for updates...${idsCL[Default]}" + echo "" + fi cd /opt/idssys/defaults if [ "`git log --pretty=%H ...refs/heads/master^ | head -n 1`" != "`git ls-remote origin -h refs/heads/master |cut -f1`" ]; then git fetch origin master >/dev/null 2>&1 @@ -37,8 +39,10 @@ if [[ "${noheader}" != *" ${1} "* ]] && [[ "${noheader}" != *" ${2} "* ]]; then git pull >/dev/null 2>&1 git submodule update --remote >/dev/null 2>&1 fi - echo -en "\e[1A"; - echo -e "\e[0K\r ${idsCL[Green]}Updates Completed${idsCL[Default]}" + if [ "${1}" != "q" ]; then + echo -en "\e[1A"; + echo -e "\e[0K\r ${idsCL[Green]}Updates Completed${idsCL[Default]}" + fi fi fi /opt/idssys/nodemgmt/nodemgmt-scripts.sh ${1} ${2} ${3} ${4} ${5} ${6} ${7} ${8} ${9} ${10} ${11} ${12} ${13} ${14}