Update nodemgmt-scripts.sh

This commit is contained in:
2019-03-03 23:31:13 -06:00
parent c3bf5d3267
commit 0ecbdeb8e1

View File

@@ -1384,7 +1384,6 @@ HAPROXY-CONFIG() {
echo -e "${idsCL[LightGreen]}Creating HAProxy Config Files${idsCL[Default]}" echo -e "${idsCL[LightGreen]}Creating HAProxy Config Files${idsCL[Default]}"
echo -e "${idsCL[LightGreen]}-------------------------------------------${idsCL[Default]}" echo -e "${idsCL[LightGreen]}-------------------------------------------${idsCL[Default]}"
nid=1 nid=1
if [[ "${NODESERVICES_CHECK}" = *"${1}"* ]]; then
for nip in "${NODE_HOSTS[@]}"; do for nip in "${NODE_HOSTS[@]}"; do
if [[ $(/sbin/ip -o -4 addr list ens192 | awk '{print $4}' | cut -d/ -f1) == *"${nip}"* ]]; then if [[ $(/sbin/ip -o -4 addr list ens192 | awk '{print $4}' | cut -d/ -f1) == *"${nip}"* ]]; then
nip='localhost ' nip='localhost '
@@ -1401,12 +1400,44 @@ HAPROXY-CONFIG() {
echo -e "${idsCL[Green]}COMPLETE${idsCL[Default]}" echo -e "${idsCL[Green]}COMPLETE${idsCL[Default]}"
nid=`expr $nid + 1` nid=`expr $nid + 1`
done done
fi
SERVICE haproxy reload SERVICE haproxy reload
echo "" echo ""
echo -e "${idsCL[Green]}HAProxy Config Files have been created.${idsCL[Default]}" echo -e "${idsCL[Green]}HAProxy Config Files have been created.${idsCL[Default]}"
echo "" echo ""
} }
NODEUPDATE() {
echo -e "${idsCL[LightGreen]}Updating All Nodes and Webservers${idsCL[Default]}"
echo -e "${idsCL[LightGreen]}-------------------------------------------${idsCL[Default]}"
nid=1
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 "Updating iDS-MySQL${nid} ($nip)... ${idsCL[Default]}"
${NCMD} "nodemgmt update q"
echo -e "${idsCL[Green]}COMPLETE${idsCL[Default]}"
nid=`expr $nid + 1`
done
nid=1
for nip in "${WEB_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 "Updating iDS-Webserver${nid} ($nip)... ${idsCL[Default]}"
${NCMD} "nodemgmt update q"
echo -e "${idsCL[Green]}COMPLETE${idsCL[Default]}"
nid=`expr $nid + 1`
done
echo ""
echo -e "${idsCL[Green]}All Nodes and Webservers have been Updated.${idsCL[Default]}"
echo ""
}
GUI(){ GUI(){
DISP_HEADER true true DISP_HEADER true true
@@ -1464,6 +1495,7 @@ if [ ${action-x} ]; then
delsites) DELSITES;; delsites) DELSITES;;
newsite) NEWSITE ${2} ${3} ${4} ${5} ${6} ${7} ${8} ${9} ${10} ${11} ${12} ${13} ${14};; newsite) NEWSITE ${2} ${3} ${4} ${5} ${6} ${7} ${8} ${9} ${10} ${11} ${12} ${13} ${14};;
update) ;; update) ;;
update-nodes) NODEUPDATE;;
backup) BACKUP;; backup) BACKUP;;
status) STATUS ${2};; status) STATUS ${2};;
status-check) STATUS-CHECK ${2};; status-check) STATUS-CHECK ${2};;