This commit is contained in:
2019-03-03 10:33:01 -06:00
parent 6de0f2f86a
commit 6718c75d4a
2 changed files with 38 additions and 4 deletions

View File

@@ -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 :

12
run.sh
View File

@@ -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}