delete site unattended

Now delete site command acept "force" option for unattended scripts.
This commit is contained in:
Cristhian Martínez Ochoa 2018-04-04 12:10:32 -05:00
parent 448870d1bc
commit 4e26e73afe
2 changed files with 10 additions and 6 deletions

View file

@ -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

View file

@ -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