db-delete-all fixed

Infinite loop caused by background process
This commit is contained in:
Cristhian Martínez Ochoa 2018-11-02 11:40:12 -07:00
parent 71f7714b5e
commit c3365e5bd3
3 changed files with 3 additions and 3 deletions

View file

@ -35,7 +35,7 @@ db_delete() {
if [[ ! -d /etc/mysql || $(conf_read mysql) != "true" || $(conf_read mysql-client) != "true" ]]; then
echo "${red}[ERROR] Seems like MySQL is not installed or Webinoly can not detect it!"
echo " - Database can not be deleted -${blu} $domain ${end}"
exit 1
return
fi
local ROOT_PASS=$( echo $(conf_read mysql-root) | openssl enc -d -a -salt )
sudo mysql --connect-timeout=10 --user=root -p$ROOT_PASS -e "$dbsetup"

View file

@ -470,7 +470,7 @@ deletesite() {
fi
fi
[[ $dbdel == [yY] ]] && db_delete $domain &
[[ $dbdel == [yY] ]] && db_delete $domain
# Delete site files
sudo rm /etc/nginx/sites-available/$domain

View file

@ -141,7 +141,7 @@ elif [[ "$domain" == "-delete-all" && -z "$type" && -z "$cache" ]]; then
# List sites then will be deleted
if [[ $domi != "html" && $domi != $(conf_read tools-port) ]]; then
# Determina if site is WP (so has DB to delete)
[[ -a $site/wp-config.php || -a $site/htdocs/wp-config.php ]] && db_delete $domi &
[[ -a $site/wp-config.php || -a $site/htdocs/wp-config.php ]] && db_delete $domi
sudo rm -rf /etc/nginx/sites-available/$domi
sudo rm -rf /etc/nginx/sites-enabled/$domi