From 4e26e73afe07fd327b0ab9766d69cfeb00c3eb12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristhian=20Mart=C3=ADnez=20Ochoa?= Date: Wed, 4 Apr 2018 12:10:32 -0500 Subject: [PATCH] delete site unattended Now delete site command acept "force" option for unattended scripts. --- lib/sites | 14 +++++++++----- plugins/site | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/sites b/lib/sites index 5da391e..5e42997 100644 --- a/lib/sites +++ b/lib/sites @@ -417,11 +417,15 @@ _EOF_ deletesite() { # Determine if site is WP, so you should delete the DB too. if [[ -a /var/www/$domain/wp-config.php || -a /var/www/$domain/htdocs/wp-config.php ]]; then - echo "${blu}Delete Database [Y/n]?${end}" - while read -r -n 1 -s dbdel; do - local dbdel=${dbdel:-y} - [[ $dbdel = [YyNn] ]] && break - done + if [[ $value != "force" ]]; then + echo "${blu}Delete Database [Y/n]?${end}" + while read -r -n 1 -s dbdel; do + local dbdel=${dbdel:-y} + [[ $dbdel = [YyNn] ]] && break + done + else + dbdel="Y" + fi fi [[ $dbdel == [yY] ]] && db_delete $domain diff --git a/plugins/site b/plugins/site index 49ee4a7..67a5ede 100644 --- a/plugins/site +++ b/plugins/site @@ -35,7 +35,7 @@ if [[ $domain == "-mysql="* ]]; then value=$(echo "${domain}" | cut -d'=' -f 2 -s) domain=$(echo "${domain}" | cut -d'=' -f 1 -s) fi -if [[ $type == "-parked="* || $type == "-proxy="* || $type == "-wp="* || $type == "-wpsubdir="* || $type == "-wpsubdom="* || $type == "-ssl-off="* || $type == "-mysql="* ]]; then +if [[ $type == "-parked="* || $type == "-proxy="* || $type == "-wp="* || $type == "-wpsubdir="* || $type == "-wpsubdom="* || $type == "-ssl-off="* || $type == "-mysql="* || $type == "-delete="* ]]; then value=$(echo "${type}" | cut -d'=' -f 2 -s) type=$(echo "${type}" | cut -d'=' -f 1 -s) fi