Update nodemgmt-scripts.sh

This commit is contained in:
2019-02-01 13:43:21 -06:00
parent 4461a50c03
commit 0d47e30588

View File

@@ -26,7 +26,7 @@ case "$1" in
do_with_root $CERT_DAEMON certonly --webroot -w /var/www/html -d $2
do_with_root chown -R root:letsencrypt /etc/letsencrypt
do_with_root chmod -R 6775 /etc/letsencrypt
echo -e "${idsCL[LightGreen]}Waiting for Replication...${idsCL[Default]}"
echo -e "${idsCL[LightGreen]}Waiting for certifcate replication between the nodes...${idsCL[Default]}"
sleep 20
"$0" service nginx reload
exit 0
@@ -37,7 +37,7 @@ case "$1" in
do_with_root $CERT_DAEMON renew --webroot -w /var/www/html 2>&1 | tee /opt/idssys/nodemgmt/cert-renewal.lastrun
do_with_root chown -R root:letsencrypt /etc/letsencrypt 2>&1 | tee -a /opt/idssys/nodemgmt/cert-renewal.lastrun
do_with_root chmod -R 6775 /etc/letsencrypt 2>&1 | tee -a /opt/idssys/nodemgmt/cert-renewal.lastrun
echo -e "${idsCL[LightGreen]}Waiting for Certificate Replication...${idsCL[Default]}"
echo -e "${idsCL[LightGreen]}Waiting for certifcate replication between the nodes...${idsCL[Default]}"
sleep 20
"$0" service nginx reload 2>&1 | tee -a /opt/idssys/nodemgmt/cert-renewal.lastrun
exit 0
@@ -55,6 +55,7 @@ case "$1" in
newsite)
NEW_SITE=${2}
echo -e "${idsCL[LightGreen]}Setting up new site for '${idsCL[Yellow]}${NEW_SITE}${idsCL[LightGreen]}'...${idsCL[Default]}"
rm -f /etc/nginx/sites-available/${NEW_SITE}.conf
rm -rf /var/www/${NEW_SITE}
@@ -91,9 +92,14 @@ case "$1" in
include conf.d/include/letsencrypt-acme-challenge.conf;
}
" > /etc/nginx/sites-available/${NEW_SITE}.conf
echo -e "${idsCL[LightGreen]}Waiting for folder replication between the nodes...${idsCL[Default]}"
sleep 20
nodemgmt set-permissions ${NEW_SITE}
nodemgmt newcert ${NEW_SITE}
echo ""
echo ""
echo -e "${idsCL[LightGreen]}The new site for '${idsCL[LightGreen]}${NEW_SITE}${idsCL[Default]}' has been created.${idsCL[Default]}"
echo ""
;;
update)