Update nodemgmt-scripts.sh
This commit is contained in:
@@ -1304,24 +1304,26 @@ SERVICE(){
|
||||
|
||||
|
||||
if [ "${1}" = "nginx" ]; then
|
||||
if [ [ "${2}" = "restart" ] || [ "${2}" = "reload" ] ] && [ "${3}" != "ns" ]; then
|
||||
if [ "${3}" != "q" ]; then
|
||||
echo -en "${idsCL[LightYellow]}Waiting for nginx config replication across the nodes... ${idsCL[Default]}"
|
||||
fi
|
||||
PH_CMD="ssh root@${WEB_HOSTS[0]}"
|
||||
${PH_CMD} "echo -e \"Service ${1} ${2}\" > /etc/nginx/test.repl"
|
||||
for nip in "${WEB_HOSTS[@]}"; do
|
||||
checkhost=$(CHECK_HOST ${nip})
|
||||
if [ "${checkhost}" != "false" ]; then
|
||||
if [ "${nip}" != "${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
|
||||
if [ "${2}" = "restart" ] || [ "${2}" = "reload" ]; then
|
||||
if [ "${3}" != "ns" ]; then
|
||||
if [ "${3}" != "q" ]; then
|
||||
echo -en "${idsCL[LightYellow]}Waiting for nginx config replication across the nodes... ${idsCL[Default]}"
|
||||
fi
|
||||
done
|
||||
${PH_CMD} rm -f /etc/nginx/test.repl
|
||||
PH_CMD="ssh root@${WEB_HOSTS[0]}"
|
||||
${PH_CMD} "echo -e \"Service ${1} ${2}\" > /etc/nginx/test.repl"
|
||||
for nip in "${WEB_HOSTS[@]}"; do
|
||||
checkhost=$(CHECK_HOST ${nip})
|
||||
if [ "${checkhost}" != "false" ]; then
|
||||
if [ "${nip}" != "${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
|
||||
fi
|
||||
done
|
||||
${PH_CMD} rm -f /etc/nginx/test.repl
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if [ "${3}" != "q" ]; then
|
||||
|
||||
Reference in New Issue
Block a user