Update test.sh

This commit is contained in:
2019-04-14 21:40:07 -05:00
parent c6278dfbe9
commit 9b38fe92b0

25
test.sh
View File

@@ -20,13 +20,26 @@ if [ "`git log --pretty=%H ...refs/heads/master^ | head -n 1`" != "`git ls-remot
fi
# nodemgmt update
NTYPE=LB
#declare -A var
var=${NTYPE}_HOSTS[@]
for nip in "${!var}"; do
echo ": ${nip}"
done
echo -en "${idsCL[LightYellow]}Waiting for nginx config replication across the nodes... ${idsCL[Default]}"
if [ "${1}" = "nginx" ]; then
if [ "${2}" = "restart" ] || [ "${2}" = "reload" ]; then
PH_CMD="ssh root@${WEB_HOSTS[0]}"
echo "HERE: ${PH_CMD}"
${PH_CMD} rm -f /etc/nginx/test.repl
${PH_CMD} "echo -e \"Service ${1} ${2}\" > /etc/nginx/test.repl"
for nip in "${WEB_HOSTS[@]}"; do
if [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) != *"${WEB_HOSTS[0]}"* ]]; then
checked=false
until [ "${checked}" = "" ]; do
checked="`${PH_CMD} \"ssh root@${nip} \"cat /etc/nginx/test.repl\" | diff - /etc/nginx/test.repl\"`"
done
fi
done
fi
fi
echo -e "${idsCL[Green]}Completed${idsCL[Default]}"