From 2ab1ee74a0e95e414e3ac3a3016e17c45e2b70fa Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Mon, 4 Feb 2019 07:57:38 -0600 Subject: [PATCH] UPDATE --- defaults.inc | 1 + nodemgmt-scripts.sh | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/defaults.inc b/defaults.inc index 65c931cb..cbaaa36c 100755 --- a/defaults.inc +++ b/defaults.inc @@ -5,6 +5,7 @@ NODE_HOSTS=10.5.10.51,10.5.10.52,10.5.10.53 NODE_SERVICES=mysql,nginx,gitea,haproxy,keepalived,maxscale CERT_DAEMON='/usr/bin/certbot' FOLDER=/opt/idssys/nodemgmt +SCRIPT=${FOLDER}/nodemgmt-scripts.sh IFS=, NODE_HOSTS=(${NODE_HOSTS}) diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index f21eeeb4..3ee09e1c 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -69,7 +69,7 @@ NEWCERT(){ echo -e "${idsCL[LightYellow]}Waiting for certifcate replication between the nodes...${idsCL[Default]}" echo "" sleep 20 - ${FOLDER}/nodemgmt-scripts.sh service nginx reload + SERVICE nginx reload } CERTRENEW(){ @@ -80,7 +80,7 @@ CERTRENEW(){ echo -e "${idsCL${idsCL[LightYellow]}}Waiting for certifcate replication between the nodes...${idsCL[Default]}" echo "" sleep 20 - ${FOLDER}/nodemgmt-scripts.sh service nginx reload 2>&1 | tee -a /opt/idssys/nodemgmt/cert-renewal.lastrun + SERVICE nginx reload 2>&1 | tee -a /opt/idssys/nodemgmt/cert-renewal.lastrun } NIGHTLYRENEW(){ @@ -89,7 +89,7 @@ NIGHTLYRENEW(){ do_with_root chown -R root:letsencrypt /etc/letsencrypt &>> /opt/idssys/nodemgmt/cert-renewal.lastrun do_with_root chmod -R 6775 /etc/letsencrypt &>> /opt/idssys/nodemgmt/cert-renewal.lastrun sleep 20 - ${FOLDER}/nodemgmt-scripts.sh service nginx reload &>> /opt/idssys/nodemgmt/cert-renewal.lastrun + SERVICE nginx reload &>> /opt/idssys/nodemgmt/cert-renewal.lastrun } DELSITE(){ @@ -127,7 +127,7 @@ DELSITE(){ nid=`expr $nid + 1` done echo "" - ${FOLDER}/nodemgmt-scripts.sh service nginx reload + SERVICE nginx reload echo -e "${idsCL[LightRed]}Site has been deleted.${idsCL[Default]}" else echo -e "${idsCL[LightRed]}No site was defined.${idsCL[Default]}" @@ -230,7 +230,7 @@ NEWSITE(){ fi ${NCMD} mkdir -p /var/www/${MAIN_SITE}/{public_folder,nginx_logs} done - nodemgmt set-permissions ${MAIN_SITE} + SET-PERMISSIONS ${MAIN_SITE} else @@ -266,9 +266,9 @@ NEWSITE(){ fi ln -s /etc/nginx/sites-available/${MAIN_SITE}.conf /etc/nginx/sites-enabled/${MAIN_SITE}.conf if [ "${CREATE_SSL}" = "true" ]; then - ${FOLDER}/nodemgmt-scripts.sh newcert ${NEW_SITE} + NEWCERT ${NEW_SITE} else - ${FOLDER}/nodemgmt-scripts.sh service nginx reload + SERVICE nginx reload fi echo "" echo -e "${idsCL[LightGreen]}The new site for '${idsCL[LightGreen]}${NEW_SITE}${idsCL[Default]}' has been created.${idsCL[Default]}"