Update nodemgmt-scripts.sh
This commit is contained in:
@@ -73,10 +73,11 @@ NEWCERT(){
|
|||||||
if [ "${NEW_CERT}" != "" ]; then
|
if [ "${NEW_CERT}" != "" ]; then
|
||||||
echo -e "${idsCL[LightGreen]}Requesting Certificate for '${idsCL[Yellow]}${NEW_CERT}${idsCL[LightGreen]}'...${idsCL[Default]}"
|
echo -e "${idsCL[LightGreen]}Requesting Certificate for '${idsCL[Yellow]}${NEW_CERT}${idsCL[LightGreen]}'...${idsCL[Default]}"
|
||||||
echo ""
|
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
|
if [ -f /etc/letsencrypt/live/${NEW_CERT}/cert.pem ]; then
|
||||||
do_with_root chown -R root:letsencrypt /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
|
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]}"
|
echo -en "${idsCL[LightYellow]}Waiting for certifcate replication between the nodes... ${idsCL[Default]}"
|
||||||
until [ "${synccomplete}" = "true" ]; do
|
until [ "${synccomplete}" = "true" ]; do
|
||||||
synccomplete=true
|
synccomplete=true
|
||||||
@@ -86,7 +87,7 @@ NEWCERT(){
|
|||||||
else NCMD="ssh root@${nip}"
|
else NCMD="ssh root@${nip}"
|
||||||
fi
|
fi
|
||||||
if [ "${NCMD}" != "" ]; then
|
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
|
if [ "${check}" != "" ]; then
|
||||||
synccomplete=false
|
synccomplete=false
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user