Skip to content

Commit

Permalink
tools site and port improved
Browse files Browse the repository at this point in the history
PHP purge now removes tools-site.
Tools-port check for PHP.
  • Loading branch information
QROkes committed Oct 30, 2019
1 parent 62da5c8 commit f1f22a5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions plugins/stack
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ elif [[ -n $purge && -n $php ]]; then
sudo rm -rf /opt/webinoly/templates/source/www.conf
sudo rm -rf /opt/webinoly/templates/source/main.cf

# Remove tools-site
sudo rm -rf /etc/nginx/sites-available/$(conf_read tools-port)
sudo rm -rf /etc/nginx/sites-enabled/$(conf_read tools-port)
sudo rm -rf /var/www/$(conf_read tools-port)
conf_delete tools-site

conf_write php purged
conf_write php-optim purged
[[ $(conf_read php-v7.4) == "true" ]] && conf_write php-v7.4 purged
Expand Down
7 changes: 6 additions & 1 deletion plugins/webinoly
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,16 @@ elif [[ -n $dbpass ]]; then


elif [[ -n $tools_port ]]; then
check_for_php
oldport="$(conf_read tools-port)"
if [[ -a /etc/nginx/sites-available/$tools_port ]]; then
echo "${red}[ERROR] Port/site '$tools_port' is already in use!${end}"
exit 1
elif [[ ! -a /etc/nginx/sites-available/$oldport ]]; then
echo "${red}[ERROR] Site '$oldport' not found!${end}"
exit 1
fi

oldport="$(conf_read tools-port)"
[[ $tools_port != true ]] && tools_port $tools_port || tools_port
newport="$(conf_read tools-port)"
if [[ $oldport != $newport && $(conf_read nginx-tool) == "true" && $(conf_read nginx) == "true" ]]; then
Expand Down Expand Up @@ -171,6 +175,7 @@ elif [[ -n $tools_site ]]; then
sudo rm -rf /etc/nginx/sites-available/$(conf_read tools-port)
sudo cp /opt/webinoly/templates/nginx/22222 /etc/nginx/sites-available/$(conf_read tools-port)
sudo sed -i "s/22222/$(conf_read tools-port)/g" /etc/nginx/sites-available/$(conf_read tools-port)
conf_delete tools-site
echo "${gre}Tools Site settings has been reset successfully!${end}"
elif [[ -a /etc/nginx/sites-available/$tools_site && ! -a /etc/nginx/sites-available/$(conf_read tools-port) ]]; then
echo "${red}[ERROR] Tools Site is not enabled! ${end}"
Expand Down

0 comments on commit f1f22a5

Please sign in to comment.