From 1d9fb16bc45dd089f322dd89ed7bc369249c6e0f Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Wed, 6 Feb 2019 11:49:17 -0600 Subject: [PATCH] Update nodemgmt-scripts.sh --- nodemgmt-scripts.sh | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index 6d6608ca..fd1579cd 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -70,24 +70,31 @@ NEWCERT(){ else NEW_CERT=${1} fi - echo -e "${idsCL[LightGreen]}Requesting Certificate for '${idsCL[Yellow]}${NEW_CERT}${idsCL[LightGreen]}'...${idsCL[Default]}" - echo "" - 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]}" + if [ "${NEW_>CERT}" != "" ]; then + echo -e "${idsCL[LightGreen]}Requesting Certificate for '${idsCL[Yellow]}${NEW_CERT}${idsCL[LightGreen]}'...${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]}" + 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 "" + 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 - 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 + echo "You havent entered a site address." + sleep 1 + NEWCERT + exit 0 fi }