Update nodemgmt-scripts.sh

This commit is contained in:
2019-02-05 22:30:19 -06:00
parent febe3dc044
commit 307f5e5229

View File

@@ -192,7 +192,12 @@ DELSITE(){
esac
shift
done
if [ -z ${DEL_SSL+x} ]; then DEL_SSL=no; fi
if [ -z ${DEL_SSL+x} ] || [[ $DEL_SSL =~ ^[Nn]$ ]]; then
DEL_SSL=no
elif [[ $DEL_SSL =~ ^[Yy]$ ]]; then
DEL_SSL=yes
fi
if [ ! -z ${DEL_SITE+x} ]; then
echo -e "${idsCL[LightRed]}Deleting site '${idsCL[Red]}${DEL_SITE}${idsCL[LightRed]}'...${idsCL[Default]}"
echo ""
@@ -217,12 +222,10 @@ DELSITE(){
if [ -d /var/www/${DEL_SITE} ]; then
${NCMD} rm -rf /var/www/${DEL_SITE}
fi
if [ "${DEL_SSL}" = "yes" ]; then
if [ -d /etc/letsencrypt/archive/${DEL_SITE} ]; then
${NCMD} rm -rf /etc/letsencrypt/archive/${DEL_SITE}
${NCMD} rm -rf /etc/letsencrypt/live/${DEL_SITE}
${NCMD} rm -f /etc/letsencrypt/renewal/${DEL_SITE}.conf
fi
if [ "${DEL_SSL}" = "yes" ] && [ -d /etc/letsencrypt/archive/${DEL_SITE} ]; then
${NCMD} rm -rf /etc/letsencrypt/archive/${DEL_SITE}
${NCMD} rm -rf /etc/letsencrypt/live/${DEL_SITE}
${NCMD} rm -f /etc/letsencrypt/renewal/${DEL_SITE}.conf
fi
echo -e "${idsCL[Green]}OK${idsCL[Default]}"
nid=`expr $nid + 1`
@@ -275,7 +278,9 @@ DELSITES(){
if [[ $response =~ ^[Yy]$ ]]; then
echo -e -n "${idsCL[LightRed]}Do you also want to delete the certs for '${SITES[${selsite}]}' as well? [y/N]${idsCL[Default]} "
read sslresponse
echo "delete - '${sslresponse}'"
DELSITE ${SITES[${selsite}]} ${sslresponse}
echo ""
DIVIDER
ENTER2CONTINUE
break
else