From b8a768aeef67fdecd4540b6c94bbbfccc071de54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristhian=20Mart=C3=ADnez=20Ochoa?= Date: Thu, 25 Jan 2018 18:01:58 -0700 Subject: [PATCH] Delete All sites improved Now we list all sites domains to be deleted and give a warning about DB's to be deleted. --- .gitignore | 2 -- plugins/site | 10 +++++++++- 2 files changed, 9 insertions(+), 3 deletions(-) delete mode 100644 .gitignore diff --git a/.gitignore b/.gitignore deleted file mode 100644 index cece647..0000000 --- a/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ - -*.tar diff --git a/plugins/site b/plugins/site index 41a546a..4176791 100644 --- a/plugins/site +++ b/plugins/site @@ -88,12 +88,20 @@ if [[ "$domain" == "-list" && -z "$type" && -z "$cache" ]]; then # Delete all sites elif [[ "$domain" == "-delete-all" && -z "$type" && -z "$cache" ]]; then + echo "${red}" + 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 + domi=$(echo $site | cut -f 4 -d "/") + # List sites then will be deleted + if [[ $domi != "html" && $domi != $(conf_read tools-port) ]]; then + echo "${gre}Your site ${blu}${domi}${gre} has been successfully deleted! ${end}" + fi # Determina if site is WP (so has DB to delete) if [[ -a $site/wp-config.php || -a $site/htdocs/wp-config.php ]]; then - domi=$(echo $site | cut -f 4 -d "/") db_delete $domi fi done