Update nodemgmt-scripts.sh

This commit is contained in:
2019-02-06 11:49:17 -06:00
parent a62fe4170b
commit 1d9fb16bc4

View File

@@ -70,24 +70,31 @@ NEWCERT(){
else else
NEW_CERT=${1} NEW_CERT=${1}
fi fi
echo -e "${idsCL[LightGreen]}Requesting Certificate for '${idsCL[Yellow]}${NEW_CERT}${idsCL[LightGreen]}'...${idsCL[Default]}" if [ "${NEW_>CERT}" != "" ]; then
echo "" echo -e "${idsCL[LightGreen]}Requesting Certificate for '${idsCL[Yellow]}${NEW_CERT}${idsCL[LightGreen]}'...${idsCL[Default]}"
do_with_root $CERT_DAEMON certonly --webroot -w /var/www/html -d ${NEW_CERT}
if [ -f /etc/letsencrypt/live/${NEW_CERT}/cert.pem ]; then
do_with_root chown -R root:letsencrypt /etc/letsencrypt
do_with_root chmod -R 6775 /etc/letsencrypt
echo -e "${idsCL[LightYellow]}Waiting for certifcate replication between the nodes...${idsCL[Default]}"
echo "" echo ""
sleep 20 do_with_root $CERT_DAEMON certonly --webroot -w /var/www/html -d ${NEW_CERT}
SERVICE nginx reload if [ -f /etc/letsencrypt/live/${NEW_CERT}/cert.pem ]; then
echo -e "${idsCL[Green]}Certificate has been successfully created for '${idsCL[Yellow]}${NEW_CERT}${idsCL[Green]}'...${idsCL[Default]}" do_with_root chown -R root:letsencrypt /etc/letsencrypt
do_with_root chmod -R 6775 /etc/letsencrypt
echo -e "${idsCL[LightYellow]}Waiting for certifcate replication between the nodes...${idsCL[Default]}"
echo ""
sleep 20
SERVICE nginx reload
echo -e "${idsCL[Green]}Certificate has been successfully created for '${idsCL[Yellow]}${NEW_CERT}${idsCL[Green]}'...${idsCL[Default]}"
else
echo -e "${idsCL[LightRed]}Certificate could not be created for '${idsCL[Yellow]}${NEW_CERT}${idsCL[Green]}'...${idsCL[Default]}"
fi
echo ""
if [ -z $action ] || [ "${action}" = "gui" ]; then
DIVIDER true
ENTER2CONTINUE
fi
else else
echo -e "${idsCL[LightRed]}Certificate could not be created for '${idsCL[Yellow]}${NEW_CERT}${idsCL[Green]}'...${idsCL[Default]}" echo "You havent entered a site address."
fi sleep 1
echo "" NEWCERT
if [ -z $action ] || [ "${action}" = "gui" ]; then exit 0
DIVIDER true
ENTER2CONTINUE
fi fi
} }