Update nodemgmt-scripts.sh
This commit is contained in:
@@ -51,105 +51,40 @@ case "$1" in
|
||||
|
||||
newcert)
|
||||
echo -e "${idsCL[LightGreen]}Requesting Certificate for '${idsCL[Yellow]}${2}${idsCL[LightGreen]}'...${idsCL[Default]}"
|
||||
# $DAEMON certonly --standalone -d $2
|
||||
$CERT_DAEMON certonly --webroot -w /var/www/html -d $2
|
||||
# chown -R root:letsencrypt /etc/letsencrypt
|
||||
# chmod -R 6775 /etc/letsencrypt
|
||||
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 Certificate Replication...${idsCL[Default]}"
|
||||
sleep 20
|
||||
"$0" service nginx reload
|
||||
exit 0
|
||||
;;
|
||||
|
||||
newmass)
|
||||
echo -e "${Green}Requesting Certificate for '${BBlue}$2${Green}'...${idsCL[Default]}"
|
||||
# $DAEMON certonly --standalone -d $2
|
||||
$DAEMON certonly --webroot -w /var/www/html -d $2
|
||||
# chown -R root:letsencrypt /etc/letsencrypt
|
||||
# chmod -R 6775 /etc/letsencrypt
|
||||
exit 0
|
||||
;;
|
||||
certrenew)
|
||||
echo -e "${idsCL[LightGreen]}Renewing Certificates...${idsCL[Default]}"
|
||||
do_with_root $DAEMON renew --webroot -w /var/www/html
|
||||
do_with_root chown -R root:letsencrypt /etc/letsencrypt
|
||||
do_with_root chmod -R 6775 /etc/letsencrypt
|
||||
echo -e "${idsCL[LightGreen]}Waiting for Certificate Replication...${idsCL[Default]}"
|
||||
sleep 20
|
||||
"$0" service nginx reload
|
||||
exit 0
|
||||
;;
|
||||
|
||||
certrenew)
|
||||
"$0" haperoxy-stop
|
||||
echo -e "${Green}Renewing Certificates...${idsCL[Default]}"
|
||||
# $DAEMON renew
|
||||
$DAEMON renew certonly --webroot -w /var/www/html -d $2
|
||||
#chown -R root:letsencrypt /etc/letsencrypt
|
||||
#chmod -R 6775 /etc/letsencrypt
|
||||
"$0" haperoxy-start
|
||||
echo -e "${Green}Waiting for Certificate Replication...${idsCL[Default]}"
|
||||
sleep 20
|
||||
"$0" nginx-reload
|
||||
exit 0
|
||||
;;
|
||||
nightlyrenew)
|
||||
rm -f /opt/idssys/nodemgmt/cert-renewal-run-$(hostname)
|
||||
do_with_root $DAEMON renew --webroot -w /var/www/html >> /opt/idssys/nodemgmt/cert-renewal-run-$(hostname)
|
||||
do_with_root chown -R root:letsencrypt /etc/letsencrypt >> /opt/idssys/nodemgmt/cert-renewal-run-$(hostname)
|
||||
do_with_root chmod -R 6775 /etc/letsencrypt >> /opt/idssys/nodemgmt/cert-renewal-run-$(hostname)
|
||||
sleep 20
|
||||
"$0" service nginx reload >> /opt/idssys/nodemgmt/cert-renewal-run-$(hostname)
|
||||
exit 0
|
||||
;;
|
||||
|
||||
nightlyrenew)
|
||||
rm -f /opt/idssys/nodemgmt/cert-renewal-run-$(hostname)
|
||||
"$0" stop >> /opt/idssys/nodemgmt/cert-renewal-run-$(hostname)
|
||||
# $DAEMON renew >> /opt/idssys/nodemgmt/cert-renewal-run-$(hostname)
|
||||
$DAEMON renew certonly --webroot -w /var/www/html -d $2 >> /opt/idssys/nodemgmt/cert-renewal-run-$(hostname)
|
||||
#chown -R root:letsencrypt /etc/letsencrypt
|
||||
#chmod -R 6775 /etc/letsencrypt
|
||||
"$0" start >> /opt/idssys/nodemgmt/cert-renewal-run-$(hostname)
|
||||
exit 0
|
||||
;;
|
||||
|
||||
|
||||
redirect-ssl)
|
||||
redirect_artica-ssl_files
|
||||
service nginx restart
|
||||
|
||||
read -n 1 -t 10 -p "Are you sure you wish to reboot (y/N)?" redirect_choice
|
||||
case "$redirect_choice" in
|
||||
[Yy]) if [ "$EUID" -ne 0 ]
|
||||
then
|
||||
service artica-webservices restart
|
||||
fi
|
||||
exit 0;;
|
||||
esac
|
||||
exit 0;;
|
||||
*)
|
||||
echo "Usage: $0 { service [service] [action] | newcert [domain(s)] | certrenew }"
|
||||
;;
|
||||
|
||||
'gui') MAIN_MENU;;
|
||||
|
||||
*)
|
||||
echo
|
||||
echo
|
||||
echo "'new' - Creates a new certificate."
|
||||
echo "---------------------------------------------------------------------------------------"
|
||||
echo "examples:"
|
||||
echo " single-domain = 'nodemgmt new www.example.com'"
|
||||
echo " multiple-domains = 'nodemgmt new www.example.com,dev.example.com,...'"
|
||||
echo
|
||||
echo "'new-mass' - Creates a new certificate, but doesnt go through the"
|
||||
echo " process of stopping and restarting nginx each time"
|
||||
echo "---------------------------------------------------------------------------------------"
|
||||
echo "examples (same as 'new'):"
|
||||
echo " single-domain = 'nodemgmt new-mass www.example.com'"
|
||||
echo " multiple-domains = 'nodemgmt new-mass www.example.com,dev.example.com,...'"
|
||||
echo
|
||||
echo "'renew' - Renews all certificates. This command could be run routinly by adding this"
|
||||
echo " line into crontab: \"0 4 * * 0 /usr/local/bin/nodemgmt renew\""
|
||||
echo "---------------------------------------------------------------------------------------"
|
||||
echo "examples:"
|
||||
echo " 'nodemgmt renew'"
|
||||
echo
|
||||
echo "'redirect-ssl' - Redirects the configured Artica certificates to use the LetsEncrypt certificates"
|
||||
echo "---------------------------------------------------------------------------------------"
|
||||
echo "examples:"
|
||||
echo " 'nodemgmt redirect-ssl'"
|
||||
echo
|
||||
echo "'stop' - Stops any process that interfere with creating a standalone server"
|
||||
echo "---------------------------------------------------------------------------------------"
|
||||
echo "examples:"
|
||||
echo " 'nodemgmt stop'"
|
||||
echo
|
||||
echo "'start' - Starts any process that had interfered with creating a standalone server"
|
||||
echo "---------------------------------------------------------------------------------------"
|
||||
echo "examples:"
|
||||
echo " 'nodemgmt start'"
|
||||
echo
|
||||
|
||||
exit 1
|
||||
;;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user