UPDATE
This commit is contained in:
@@ -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
|
NODE_SERVICES=mysql,nginx,gitea,haproxy,keepalived,maxscale
|
||||||
CERT_DAEMON='/usr/bin/certbot'
|
CERT_DAEMON='/usr/bin/certbot'
|
||||||
FOLDER=/opt/idssys/nodemgmt
|
FOLDER=/opt/idssys/nodemgmt
|
||||||
|
SCRIPT=${FOLDER}/nodemgmt-scripts.sh
|
||||||
|
|
||||||
IFS=,
|
IFS=,
|
||||||
NODE_HOSTS=(${NODE_HOSTS})
|
NODE_HOSTS=(${NODE_HOSTS})
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ NEWCERT(){
|
|||||||
echo -e "${idsCL[LightYellow]}Waiting for certifcate replication between the nodes...${idsCL[Default]}"
|
echo -e "${idsCL[LightYellow]}Waiting for certifcate replication between the nodes...${idsCL[Default]}"
|
||||||
echo ""
|
echo ""
|
||||||
sleep 20
|
sleep 20
|
||||||
${FOLDER}/nodemgmt-scripts.sh service nginx reload
|
SERVICE nginx reload
|
||||||
}
|
}
|
||||||
|
|
||||||
CERTRENEW(){
|
CERTRENEW(){
|
||||||
@@ -80,7 +80,7 @@ CERTRENEW(){
|
|||||||
echo -e "${idsCL${idsCL[LightYellow]}}Waiting for certifcate replication between the nodes...${idsCL[Default]}"
|
echo -e "${idsCL${idsCL[LightYellow]}}Waiting for certifcate replication between the nodes...${idsCL[Default]}"
|
||||||
echo ""
|
echo ""
|
||||||
sleep 20
|
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(){
|
NIGHTLYRENEW(){
|
||||||
@@ -89,7 +89,7 @@ NIGHTLYRENEW(){
|
|||||||
do_with_root chown -R root:letsencrypt /etc/letsencrypt &>> /opt/idssys/nodemgmt/cert-renewal.lastrun
|
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
|
do_with_root chmod -R 6775 /etc/letsencrypt &>> /opt/idssys/nodemgmt/cert-renewal.lastrun
|
||||||
sleep 20
|
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(){
|
DELSITE(){
|
||||||
@@ -127,7 +127,7 @@ DELSITE(){
|
|||||||
nid=`expr $nid + 1`
|
nid=`expr $nid + 1`
|
||||||
done
|
done
|
||||||
echo ""
|
echo ""
|
||||||
${FOLDER}/nodemgmt-scripts.sh service nginx reload
|
SERVICE nginx reload
|
||||||
echo -e "${idsCL[LightRed]}Site has been deleted.${idsCL[Default]}"
|
echo -e "${idsCL[LightRed]}Site has been deleted.${idsCL[Default]}"
|
||||||
else
|
else
|
||||||
echo -e "${idsCL[LightRed]}No site was defined.${idsCL[Default]}"
|
echo -e "${idsCL[LightRed]}No site was defined.${idsCL[Default]}"
|
||||||
@@ -230,7 +230,7 @@ NEWSITE(){
|
|||||||
fi
|
fi
|
||||||
${NCMD} mkdir -p /var/www/${MAIN_SITE}/{public_folder,nginx_logs}
|
${NCMD} mkdir -p /var/www/${MAIN_SITE}/{public_folder,nginx_logs}
|
||||||
done
|
done
|
||||||
nodemgmt set-permissions ${MAIN_SITE}
|
SET-PERMISSIONS ${MAIN_SITE}
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
@@ -266,9 +266,9 @@ NEWSITE(){
|
|||||||
fi
|
fi
|
||||||
ln -s /etc/nginx/sites-available/${MAIN_SITE}.conf /etc/nginx/sites-enabled/${MAIN_SITE}.conf
|
ln -s /etc/nginx/sites-available/${MAIN_SITE}.conf /etc/nginx/sites-enabled/${MAIN_SITE}.conf
|
||||||
if [ "${CREATE_SSL}" = "true" ]; then
|
if [ "${CREATE_SSL}" = "true" ]; then
|
||||||
${FOLDER}/nodemgmt-scripts.sh newcert ${NEW_SITE}
|
NEWCERT ${NEW_SITE}
|
||||||
else
|
else
|
||||||
${FOLDER}/nodemgmt-scripts.sh service nginx reload
|
SERVICE nginx reload
|
||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
echo -e "${idsCL[LightGreen]}The new site for '${idsCL[LightGreen]}${NEW_SITE}${idsCL[Default]}' has been created.${idsCL[Default]}"
|
echo -e "${idsCL[LightGreen]}The new site for '${idsCL[LightGreen]}${NEW_SITE}${idsCL[Default]}' has been created.${idsCL[Default]}"
|
||||||
|
|||||||
Reference in New Issue
Block a user