Update services.inc
This commit is contained in:
@@ -238,31 +238,30 @@ SERVICE(){
|
||||
${PH_CMD} rm -f ${NM_REPL_NGINX_PATHS[${RUN_NODE_TYPE}]}/test.repl
|
||||
fi
|
||||
fi
|
||||
if [ "${1}" = "pdns" ] && ([ "${3}" == "" ] || [ "${3}" == "all" ]); then
|
||||
if [ "${2}" = "restart" ] || [ "${2}" = "reload" ]; then
|
||||
if [ "${3}" != "ns" ]; then
|
||||
if [ "${3}" != "q" ]; then
|
||||
echo -en "${idsCL[LightYellow]}Verifying replication across the nodes... ${idsCL[Default]}"
|
||||
fi
|
||||
if [[ "${RUN_NODE_IP}" == *"${!NT_HOST}"* ]]; then
|
||||
PH_CMD=""
|
||||
else
|
||||
PH_CMD="ssh root@${!NT_HOST}"
|
||||
fi
|
||||
${PH_CMD} touch /etc/powerdns/test.repl
|
||||
for nip in "${!NT_HOSTS}"; do
|
||||
checkhost=$(CHECK_HOST ${nip})
|
||||
if [ "${checkhost}" != "false" ] && [ "${nip}" != "${!NT_HOST}" ]; then
|
||||
checked=false
|
||||
until [ "${checked}" = "true" ]; do
|
||||
checked="`${PH_CMD} ssh root@${nip} [ -f /etc/powerdns/test.repl ] && [ $(expr $(date +%s) - $(stat -L --format %Y /etc/powerdns/test.repl)) -le 90 ] && echo true`"
|
||||
done
|
||||
fi
|
||||
done
|
||||
${PH_CMD} rm -f /etc/powerdns/test.repl
|
||||
elif [ "${1}" = "pdns" ] && ([ "${3}" == "" ] || [ "${3}" == "all" ]); then
|
||||
if [ "${2}" = "restart" ] || [ "${2}" = "reload" ]; then
|
||||
if [ "${3}" != "ns" ]; then
|
||||
if [ "${3}" != "q" ]; then
|
||||
echo -en "${idsCL[LightYellow]}Verifying replication across the nodes... ${idsCL[Default]}"
|
||||
fi
|
||||
if [[ "${RUN_NODE_IP}" == *"${!NT_HOST}"* ]]; then
|
||||
PH_CMD=""
|
||||
else
|
||||
PH_CMD="ssh root@${!NT_HOST}"
|
||||
fi
|
||||
${PH_CMD} touch /etc/powerdns/test.repl
|
||||
for nip in "${!NT_HOSTS}"; do
|
||||
checkhost=$(CHECK_HOST ${nip})
|
||||
if [ "${checkhost}" != "false" ] && [ "${nip}" != "${!NT_HOST}" ]; then
|
||||
checked=false
|
||||
until [ "${checked}" = "true" ]; do
|
||||
checked="`${PH_CMD} ssh root@${nip} [ -f /etc/powerdns/test.repl ] && [ $(expr $(date +%s) - $(stat -L --format %Y /etc/powerdns/test.repl)) -le 90 ] && echo true`"
|
||||
done
|
||||
fi
|
||||
done
|
||||
${PH_CMD} rm -f /etc/powerdns/test.repl
|
||||
fi
|
||||
|
||||
fi
|
||||
elif [ "${1}" = "apache2-x" ]; then
|
||||
if [ "${2}" = "restart" ] || [ "${2}" = "reload" ]; then
|
||||
if [ "${3}" != "ns" ]; then
|
||||
|
||||
Reference in New Issue
Block a user