db-delete-all fixed
Infinite loop caused by background process
This commit is contained in:
parent
71f7714b5e
commit
c3365e5bd3
|
@ -35,7 +35,7 @@ db_delete() {
|
||||||
if [[ ! -d /etc/mysql || $(conf_read mysql) != "true" || $(conf_read mysql-client) != "true" ]]; then
|
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 "${red}[ERROR] Seems like MySQL is not installed or Webinoly can not detect it!"
|
||||||
echo " - Database can not be deleted -${blu} $domain ${end}"
|
echo " - Database can not be deleted -${blu} $domain ${end}"
|
||||||
exit 1
|
return
|
||||||
fi
|
fi
|
||||||
local ROOT_PASS=$( echo $(conf_read mysql-root) | openssl enc -d -a -salt )
|
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"
|
sudo mysql --connect-timeout=10 --user=root -p$ROOT_PASS -e "$dbsetup"
|
||||||
|
|
|
@ -470,7 +470,7 @@ deletesite() {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[[ $dbdel == [yY] ]] && db_delete $domain &
|
[[ $dbdel == [yY] ]] && db_delete $domain
|
||||||
|
|
||||||
# Delete site files
|
# Delete site files
|
||||||
sudo rm /etc/nginx/sites-available/$domain
|
sudo rm /etc/nginx/sites-available/$domain
|
||||||
|
|
|
@ -141,7 +141,7 @@ elif [[ "$domain" == "-delete-all" && -z "$type" && -z "$cache" ]]; then
|
||||||
# List sites then will be deleted
|
# List sites then will be deleted
|
||||||
if [[ $domi != "html" && $domi != $(conf_read tools-port) ]]; then
|
if [[ $domi != "html" && $domi != $(conf_read tools-port) ]]; then
|
||||||
# Determina if site is WP (so has DB to delete)
|
# 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-available/$domi
|
||||||
sudo rm -rf /etc/nginx/sites-enabled/$domi
|
sudo rm -rf /etc/nginx/sites-enabled/$domi
|
||||||
|
|
Loading…
Reference in a new issue