Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
last minute fixes before release.
  • Loading branch information
QROkes committed May 1, 2019
1 parent 3cede39 commit 9ed5ed2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 67 deletions.
58 changes: 5 additions & 53 deletions lib/api-events_sample
Original file line number Diff line number Diff line change
@@ -1,60 +1,12 @@
#!/bin/bash

# Installation process
#
# i1 - Common Packages
# i2 - Common Packages Finished
#
# in1 - NGINX Installation
# in2 - NGINX Installation Finished
# in3 - NGINX Optimization
# in4 - Ubuntu Optimization
# in5 - SWAP Creation
# in6 - SWAP Creation Finished
# in7 - Ubuntu Optimization Finished
# in8 - NGINX Optimization Finished
# in9 - NGINX Tools
# in10 - NGINX Tools Finished
#
# ip1 - PHP Installation
# ip2 - PHP Installation Finished
# ip3 - PHP Optimization
# ip4 - PHP Optimization Finished
# ip5 - PHP Tools
# ip6 - PHP Tools site creation
# ip7 - PHP Tools site creation Finished
# ip8 - PHP Tools Finished
#
# im1 - MySQL Installation
# im2 - MySQL Client Installation
# im3 - MySQL Client Installation Finished
# im4 - MySQL Installation Finished
# im5 - MySQL Tool (PhpMyAdmin)
# im6 - MySQL Tool (PhpMyAdmin) Finished
#
#
# Purge (UnInstall)
#
# pn1 - NGINX Purge
# pn2 - NGINX Delete All Sites
# pn3 - NGINX Delete All Sites Finished
# pn4 - NGINX Purge Finished
# pn5 - NGINX Purge Tools
# pn6 - NGINX Purge Tools Finished
# pn7 - Ubuntu Optimization Purge
# pn8 - Ubuntu Optimization Purge Finished
# pn9 - SWAP Purge
# pn10 - SWAP Purge Finished
#
# pp1 - PHP Purge
# pp2 - PHP Purge Finished
#
# pm1 - MySQL Purge
# pm2 - MySQL Tool (PhpMyAdmin) Purge
# pm3 - MySQL Tool (PhpMyAdmin) Purge Finished
# pm4 - MySQL Purge Finished
# Internal API or Events
# Docs: https://webinoly.com/en/documentation/internal-api-events/

# Description: Execute actions at certain points or events, for example at the end of the "stack" command each time is executed
# or after Nginx is installed. Just rename this file to "api-events" and check for the complete list of status codes in the documentation.

# Just put all your code inside this function:
api-events_catch_status() {
echo "${blu}API Status: $1 ${end}"
}
6 changes: 3 additions & 3 deletions lib/site-ssl
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,12 @@ site_ssl_on() {

cronmail=$( sudo grep -F "MAILTO=" /var/spool/cron/crontabs/root )
cronrene=$( sudo grep -F "certbot renew" /var/spool/cron/crontabs/root )
[[ -z $cronmail && -n $cermail && -z $cronrene ]] && echo "MAILTO=${cermail}" | sudo tee -a /var/spool/cron/crontabs/root
[[ -z $cronrene ]] && echo '15 3 * * 7 certbot renew --post-hook "service nginx restart"' | sudo tee -a /var/spool/cron/crontabs/root
[[ -z $cronmail && -n $cermail && -z $cronrene ]] && echo "MAILTO=${cermail}" | sudo tee -a /var/spool/cron/crontabs/root > /dev/null
[[ -z $cronrene ]] && echo '15 3 * * 7 certbot renew --post-hook "service nginx restart"' | sudo tee -a /var/spool/cron/crontabs/root > /dev/null

echo "${gre}SSL have been successfully enabled for your site -${blu} $domain${end}"
elif [[ -a /etc/letsencrypt/live/$domain/fullchain.pem && $ssl == "force-renewal" ]]; then
echo "${gre}SSL Cert -${blu} $domain$ -${gre}has been Forced to Renew!${end}"
echo "${gre}SSL Cert ${blu}- $domain$ - ${gre}has been Forced to Renew!${end}"
elif [[ ! -a /etc/letsencrypt/live/$domain/fullchain.pem ]]; then
echo "${red}"
echo "[ERROR] Unable to create the new certificate!"
Expand Down
2 changes: 1 addition & 1 deletion lib/sites
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ deletesite() {
[[ $revoke = [YyNn] ]] && break
done
fi
[[ $revoke =~ ^(on|y|Y)$ ]] && ssl_revoke
[[ $revoke =~ ^(on|y|Y)$ && -d /etc/letsencrypt/live/$domain ]] && ssl_revoke


# Delete site files
Expand Down
13 changes: 3 additions & 10 deletions plugins/site
Original file line number Diff line number Diff line change
Expand Up @@ -145,20 +145,13 @@ elif [[ -n $delete_all ]]; then
echo "All your sites files will be removed."
echo "This action will only delete Databases attached to a WordPress site, any other Database will not be deleted."
echo "${end}"
# List all sites in /var/www/ folder
for site in "/var/www"/*
do
delete="force"
domain=$(echo $site | cut -f 4 -d "/")
[[ $domain != "html" && $domain != $(conf_read tools-port) ]] && deletesite
done


# List all remaining sites (parked and proxy)
for site in "/etc/nginx/sites-available"/*
do
delete="force"
domi=$(echo $site | cut -f 5 -d "/")
[[ $domi != "html" && $domi != "default" && $domi != $(conf_read tools-port) ]] && deletesite
domain=$(echo $site | cut -f 5 -d "/")
[[ $domain != "html" && $domi != "default" && $domain != $(conf_read tools-port) ]] && deletesite
done

# Delete all files - double check!
Expand Down

0 comments on commit 9ed5ed2

Please sign in to comment.