Update nodemgmt-scripts.sh

This commit is contained in:
2019-04-13 22:36:39 -05:00
parent c67afdd608
commit b138837bdd

View File

@@ -467,30 +467,32 @@ DEL-SSL(){
rm -f /etc/letsencrypt/renewal/${DEL_SSL}.conf rm -f /etc/letsencrypt/renewal/${DEL_SSL}.conf
echo -e "${idsCL[Green]}OK${idsCL[Default]}" echo -e "${idsCL[Green]}OK${idsCL[Default]}"
echo "" echo ""
echo -en "${idsCL[LightYellow]}Waiting for certificate replication between the nodes... ${idsCL[Default]}"
checked=false # echo -en "${idsCL[LightYellow]}Waiting for certificate replication between the nodes... ${idsCL[Default]}"
timeout=`date --date='2 minutes' +%s` # checked=false
until [ "${checked}" = "" ]; do # timeout=`date --date='2 minutes' +%s`
tchecked='' # until [ "${checked}" = "" ]; do
for nip in "${WEB_HOSTS[@]}"; do # tchecked=''
if [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) == *"${nip}"* ]]; then NCMD='' # for nip in "${WEB_HOSTS[@]}"; do
else NCMD="ssh root@${nip}" # if [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) == *"${nip}"* ]]; then NCMD=''
fi # else NCMD="ssh root@${nip}"
if [ "${NCMD}" != "" ]; then # fi
if ${NCMD} "[ -d /etc/letsencrypt/live/${DEL_SSL} ]"; then # if [ "${NCMD}" != "" ]; then
tchecked+=false # if ${NCMD} "[ -d /etc/letsencrypt/live/${DEL_SSL} ]"; then
else # tchecked+=false
tchecked+='' # else
fi # tchecked+=''
fi # fi
done # fi
checked=${tchecked} # done
if [ "`date +%s`" -gt "$timeout" ]; then # checked=${tchecked}
echo -e "${idsCL[Red]}Timeout${idsCL[Default]}" # if [ "`date +%s`" -gt "$timeout" ]; then
timeout=true # echo -e "${idsCL[Red]}Timeout${idsCL[Default]}"
break # timeout=true
fi # break
done # fi
# done
else else
echo -e "${idsCL[LightRed]}The SSL files folder for '${idsCL[Red]}${DEL_SSL}${idsCL[LightRed]}' could not be found.${idsCL[Default]}" echo -e "${idsCL[LightRed]}The SSL files folder for '${idsCL[Red]}${DEL_SSL}${idsCL[LightRed]}' could not be found.${idsCL[Default]}"
exit 1 exit 1
@@ -499,7 +501,7 @@ DEL-SSL(){
echo -e "${idsCL[Green]}Completed${idsCL[Default]}" echo -e "${idsCL[Green]}Completed${idsCL[Default]}"
fi fi
echo echo
SERVICE nginx reload # SERVICE nginx reload
echo -e "${idsCL[LightRed]}The SSL certificate has been removed fromt be nodes.${idsCL[Default]}" echo -e "${idsCL[LightRed]}The SSL certificate has been removed fromt be nodes.${idsCL[Default]}"
fi fi
} }