Update nodemgmt-scripts.sh
This commit is contained in:
@@ -511,39 +511,44 @@ DEL-SSL(){
|
|||||||
DEL_SSL=${1}
|
DEL_SSL=${1}
|
||||||
fi
|
fi
|
||||||
if [ ! -z ${DEL_SSL+x} ] && [ "${DEL_SSL}" != "" ]; then
|
if [ ! -z ${DEL_SSL+x} ] && [ "${DEL_SSL}" != "" ]; then
|
||||||
echo -e "${idsCL[LightRed]}Deleting the SSL certificates for '${idsCL[Red]}${DEL_SSL}${idsCL[LightRed]}'...${idsCL[Default]}"
|
if [ -d /etc/letsencrypt/live/${DEL_SSL} ]"; then
|
||||||
echo ""
|
echo -e "${idsCL[LightRed]}Deleting the SSL certificates for '${idsCL[Red]}${DEL_SSL}${idsCL[LightRed]}'...${idsCL[Default]}"
|
||||||
|
echo ""
|
||||||
|
|
||||||
echo -en "${idsCL[LightRed]}Removing Files and Folders... ${idsCL[Default]}"
|
echo -en "${idsCL[LightRed]}Removing Files and Folders... ${idsCL[Default]}"
|
||||||
# rm -rf /etc/letsencrypt/archive/${DEL_SITE}
|
rm -rf /etc/letsencrypt/archive/${DEL_SITE}
|
||||||
# rm -rf /etc/letsencrypt/live/${DEL_SITE}
|
rm -rf /etc/letsencrypt/live/${DEL_SITE}
|
||||||
# rm -f /etc/letsencrypt/renewal/${DEL_SITE}.conf
|
rm -f /etc/letsencrypt/renewal/${DEL_SITE}.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]}"
|
echo -en "${idsCL[LightYellow]}Waiting for certificate replication between the nodes... ${idsCL[Default]}"
|
||||||
checked=false
|
checked=false
|
||||||
timeout=`date --date='2 minutes' +%s`
|
timeout=`date --date='2 minutes' +%s`
|
||||||
until [ "${checked}" = "" ]; do
|
until [ "${checked}" = "" ]; do
|
||||||
tchecked=''
|
tchecked=''
|
||||||
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 NCMD=''
|
if [[ $(/sbin/ip -o -4 addr list ens192 | awk '{print $4}' | cut -d/ -f1) == *"${nip}"* ]]; then NCMD=''
|
||||||
else NCMD="ssh root@${nip}"
|
else NCMD="ssh root@${nip}"
|
||||||
fi
|
|
||||||
if [ "${NCMD}" != "" ]; then
|
|
||||||
if ${NCMD} "[ -d /etc/letsencrypt/live/${DEL_SITE} ]"; then
|
|
||||||
tchecked+=false
|
|
||||||
else
|
|
||||||
tchecked+=''
|
|
||||||
fi
|
fi
|
||||||
|
if [ "${NCMD}" != "" ]; then
|
||||||
|
if ${NCMD} "[ -d /etc/letsencrypt/live/${DEL_SSL} ]"; then
|
||||||
|
tchecked+=false
|
||||||
|
else
|
||||||
|
tchecked+=''
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
checked=${tchecked}
|
||||||
|
if [ "`date +%s`" -gt "$timeout" ]; then
|
||||||
|
echo -e "${idsCL[Red]}Timeout${idsCL[Default]}"
|
||||||
|
timeout=true
|
||||||
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
checked=${tchecked}
|
else
|
||||||
if [ "`date +%s`" -gt "$timeout" ]; then
|
echo -e "${idsCL[LightRed]}The SSL files folder for '${idsCL[Red]}${DEL_SSL}${idsCL[LightRed]}' could not be found.${idsCL[Default]}"
|
||||||
echo -e "${idsCL[Red]}Timeout${idsCL[Default]}"
|
exit 1
|
||||||
timeout=true
|
fi
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
if [ "${timeout}" != "true" ]; then
|
if [ "${timeout}" != "true" ]; then
|
||||||
echo -e "${idsCL[Green]}Completed${idsCL[Default]}"
|
echo -e "${idsCL[Green]}Completed${idsCL[Default]}"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user