Update nodemgmt-scripts.sh
This commit is contained in:
@@ -66,118 +66,124 @@ MAIN_MENU() {
|
|||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
|
||||||
start)
|
haproxy-start)
|
||||||
sleep 15
|
sleep 15
|
||||||
echo -e "${BBlue}HAProxy Starting...${Color_Off}"
|
echo -e "${idsCL[LightBlue]}HAProxy Starting...${idsCL[Default]}"
|
||||||
service haproxy start
|
ssh root@10.5.10.51 service haproxy start
|
||||||
ssh root@10.5.10.52 service haproxy start
|
ssh root@10.5.10.52 service haproxy start
|
||||||
ssh root@10.5.10.53 service haproxy start
|
ssh root@10.5.10.53 service haproxy start
|
||||||
echo -e "${BBlue}NGINX Reload...${Color_Off}"
|
exit 0;;
|
||||||
service nginx reload
|
|
||||||
ssh root@10.5.10.52 service nginx reload
|
|
||||||
ssh root@10.5.10.53 service nginx reload
|
|
||||||
|
|
||||||
exit 0
|
haproxy-stop)
|
||||||
;;
|
echo -e "${idsCL[LightBlue]}HAProxy Stopping...${idsCL[Default]}"
|
||||||
|
ssh root@10.5.10.51 service haproxy stop
|
||||||
stop)
|
|
||||||
echo -e "${BBlue}HAProxy Stopping...${Color_Off}"
|
|
||||||
service haproxy stop
|
|
||||||
ssh root@10.5.10.52 service haproxy stop
|
ssh root@10.5.10.52 service haproxy stop
|
||||||
ssh root@10.5.10.53 service haproxy stop
|
ssh root@10.5.10.53 service haproxy stop
|
||||||
exit 0;;
|
exit 0;;
|
||||||
|
|
||||||
|
haproxy-restart)
|
||||||
|
sleep 15
|
||||||
|
echo -e "${idsCL[LightBlue]}HAProxy Starting...${idsCL[Default]}"
|
||||||
|
ssh root@10.5.10.51 service haproxy restart
|
||||||
|
ssh root@10.5.10.52 service haproxy restart
|
||||||
|
ssh root@10.5.10.53 service haproxy restart
|
||||||
|
exit 0;;
|
||||||
|
|
||||||
gogs-start)
|
gogs-start)
|
||||||
echo -e "${BBlue}Gogs Starting...${Color_Off}"
|
echo -e "${idsCL[LightBlue]}Gogs Starting...${idsCL[Default]}"
|
||||||
service gogs start
|
ssh root@10.5.10.51 service gogs start
|
||||||
ssh root@10.5.10.52 service gogs start
|
ssh root@10.5.10.52 service gogs start
|
||||||
ssh root@10.5.10.53 service gogs start
|
ssh root@10.5.10.53 service gogs start
|
||||||
exit 0;;
|
exit 0;;
|
||||||
|
|
||||||
gogs-stop)
|
gogs-stop)
|
||||||
echo -e "${BBlue}Gogs Stopping...${Color_Off}"
|
echo -e "${idsCL[LightBlue]}Gogs Stopping...${idsCL[Default]}"
|
||||||
service gogs stop
|
ssh root@10.5.10.51 service gogs stop
|
||||||
ssh root@10.5.10.52 service gogs stop
|
ssh root@10.5.10.52 service gogs stop
|
||||||
ssh root@10.5.10.53 service gogs stop
|
ssh root@10.5.10.53 service gogs stop
|
||||||
exit 0;;
|
exit 0;;
|
||||||
|
|
||||||
gogs-restart)
|
gogs-restart)
|
||||||
echo -e "${BBlue}Gogs Restarting...${Color_Off}"
|
echo -e "${idsCL[LightBlue]}Gogs Restarting...${idsCL[Default]}"
|
||||||
service gogs restart
|
ssh root@10.5.10.51 service gogs restart
|
||||||
ssh root@10.5.10.52 service gogs restart
|
ssh root@10.5.10.52 service gogs restart
|
||||||
ssh root@10.5.10.53 service gogs restart
|
ssh root@10.5.10.53 service gogs restart
|
||||||
exit 0;;
|
exit 0;;
|
||||||
|
|
||||||
nginx-start)
|
nginx-start)
|
||||||
echo -e "${BBlue}NGINX Starting...${Color_Off}"
|
echo -e "${idsCL[LightBlue]}NGINX Starting...${idsCL[Default]}"
|
||||||
service nginx start
|
ssh root@10.5.10.51 service nginx start
|
||||||
ssh root@10.5.10.52 service nginx start
|
ssh root@10.5.10.52 service nginx start
|
||||||
ssh root@10.5.10.53 service nginx start
|
ssh root@10.5.10.53 service nginx start
|
||||||
exit 0;;
|
exit 0;;
|
||||||
|
|
||||||
nginx-stop)
|
nginx-stop)
|
||||||
echo -e "${BBlue}NGINX Stopping...${Color_Off}"
|
echo -e "${idsCL[LightBlue]}NGINX Stopping...${idsCL[Default]}"
|
||||||
service nginx stop
|
ssh root@10.5.10.51 service nginx stop
|
||||||
ssh root@10.5.10.52 service nginx stop
|
ssh root@10.5.10.52 service nginx stop
|
||||||
ssh root@10.5.10.53 service nginx stop
|
ssh root@10.5.10.53 service nginx stop
|
||||||
exit 0;;
|
exit 0;;
|
||||||
|
|
||||||
nginx-restart)
|
nginx-restart)
|
||||||
echo -e "${BBlue}NGINX Restarting...${Color_Off}"
|
echo -e "${idsCL[LightBlue]}NGINX Restarting...${idsCL[Default]}"
|
||||||
service nginx restart
|
ssh root@10.5.10.51 service nginx restart
|
||||||
ssh root@10.5.10.52 service nginx restart
|
ssh root@10.5.10.52 service nginx restart
|
||||||
ssh root@10.5.10.53 service nginx restart
|
ssh root@10.5.10.53 service nginx restart
|
||||||
exit 0;;
|
exit 0;;
|
||||||
|
|
||||||
reload)
|
nginx-reload)
|
||||||
service nginx reload
|
echo -e "${idsCL[LightBlue]}NGINX Reloading...${idsCL[Default]}"
|
||||||
|
ssh root@10.5.10.51 service nginx reload
|
||||||
ssh root@10.5.10.52 service nginx reload
|
ssh root@10.5.10.52 service nginx reload
|
||||||
ssh root@10.5.10.53 service nginx reload
|
ssh root@10.5.10.53 service nginx reload
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
|
||||||
new)
|
newcert)
|
||||||
# "$0" stop
|
"$0" haperoxy-stop
|
||||||
echo -e "${Green}Requesting Certificate for '${BBlue}$2${Green}'...${Color_Off}"
|
echo -e "${Green}Requesting Certificate for '${BBlue}$2${Green}'...${idsCL[Default]}"
|
||||||
# $DAEMON certonly --standalone -d $2
|
# $DAEMON certonly --standalone -d $2
|
||||||
$DAEMON certonly --webroot -w /var/www/html -d $2
|
$DAEMON certonly --webroot -w /var/www/html -d $2
|
||||||
# chown -R root:letsencrypt /etc/letsencrypt
|
# chown -R root:letsencrypt /etc/letsencrypt
|
||||||
# chmod -R 6775 /etc/letsencrypt
|
# chmod -R 6775 /etc/letsencrypt
|
||||||
# "$0" start
|
"$0" haproxy-start
|
||||||
# redirect_artica-ssl_files
|
echo -e "${Green}Waiting for Certificate Replication...${idsCL[Default]}"
|
||||||
|
sleep 20
|
||||||
|
"$0" nginx-reload
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
|
||||||
new-mass)
|
newmass)
|
||||||
echo -e "${Green}Requesting Certificate for '${BBlue}$2${Green}'...${Color_Off}"
|
echo -e "${Green}Requesting Certificate for '${BBlue}$2${Green}'...${idsCL[Default]}"
|
||||||
# $DAEMON certonly --standalone -d $2
|
# $DAEMON certonly --standalone -d $2
|
||||||
$DAEMON certonly --webroot -w /var/www/html -d $2
|
$DAEMON certonly --webroot -w /var/www/html -d $2
|
||||||
# chown -R root:letsencrypt /etc/letsencrypt
|
# chown -R root:letsencrypt /etc/letsencrypt
|
||||||
# chmod -R 6775 /etc/letsencrypt
|
# chmod -R 6775 /etc/letsencrypt
|
||||||
# redirect_artica-ssl_files
|
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
|
||||||
renew)
|
certrenew)
|
||||||
"$0" stop
|
"$0" haperoxy-stop
|
||||||
echo -e "${Green}Renewing Certificates...${Color_Off}"
|
echo -e "${Green}Renewing Certificates...${idsCL[Default]}"
|
||||||
# $DAEMON renew
|
# $DAEMON renew
|
||||||
$DAEMON renew certonly --webroot -w /var/www/html -d $2
|
$DAEMON renew certonly --webroot -w /var/www/html -d $2
|
||||||
chown -R root:letsencrypt /etc/letsencrypt
|
#chown -R root:letsencrypt /etc/letsencrypt
|
||||||
chmod -R 6775 /etc/letsencrypt
|
#chmod -R 6775 /etc/letsencrypt
|
||||||
"$0" start
|
"$0" haperoxy-start
|
||||||
# redirect_artica-ssl_files
|
echo -e "${Green}Waiting for Certificate Replication...${idsCL[Default]}"
|
||||||
|
sleep 20
|
||||||
|
"$0" nginx-reload
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
|
||||||
nightlyrenew)
|
nightlyrenew)
|
||||||
rm -f /opt/nodemgmt/cert-renewal-run-$(hostname)
|
rm -f /opt/idssys/nodemgmt/cert-renewal-run-$(hostname)
|
||||||
"$0" stop >> /opt/nodemgmt/cert-renewal-run-$(hostname)
|
"$0" stop >> /opt/idssys/nodemgmt/cert-renewal-run-$(hostname)
|
||||||
# $DAEMON renew >> /opt/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/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
|
#chown -R root:letsencrypt /etc/letsencrypt
|
||||||
chmod -R 6775 /etc/letsencrypt
|
#chmod -R 6775 /etc/letsencrypt
|
||||||
"$0" start >> /opt/nodemgmt/cert-renewal-run-$(hostname)
|
"$0" start >> /opt/idssys/nodemgmt/cert-renewal-run-$(hostname)
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user