Update nodemgmt-scripts.sh

This commit is contained in:
2019-02-06 19:29:36 -06:00
parent d6bae54f27
commit 4527e9ef95

View File

@@ -73,10 +73,11 @@ NEWCERT(){
if [ "${NEW_CERT}" != "" ]; then
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}
do_with_root $CERT_DAEMON certonly --webroot -w /var/www/html -d ${NEW_CERT} 2>&1 | tee /opt/idssys/nodemgmt/cert-request.lastrun
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
do_with_root chown -R root:letsencrypt /etc/letsencrypt 2>&1 | tee /opt/idssys/nodemgmt/cert-request.lastrun
do_with_root chmod -R 6775 /etc/letsencrypt 2>&1 | tee /opt/idssys/nodemgmt/cert-request.lastrun
yes | cp -rfH /opt/idssys/nodemgmt/cert-request.lastrun /etc/letsencrypt/cert-request.lastrun
echo -en "${idsCL[LightYellow]}Waiting for certifcate replication between the nodes... ${idsCL[Default]}"
until [ "${synccomplete}" = "true" ]; do
synccomplete=true
@@ -86,7 +87,7 @@ NEWCERT(){
else NCMD="ssh root@${nip}"
fi
if [ "${NCMD}" != "" ]; then
check=`${NCMD} "cat /etc/letsencrypt/cert-renewal.lastrun" | diff - /etc/letsencrypt/cert-renewal.lastrun`
check=`${NCMD} "cat /etc/letsencrypt/cert-request.lastrun" | diff - /etc/letsencrypt/cert-request.lastrun`
if [ "${check}" != "" ]; then
synccomplete=false
fi