From d942f85d319911d897dac2bab309e469405e6e73 Mon Sep 17 00:00:00 2001 From: dpeca Date: Fri, 6 Apr 2018 18:20:35 +0200 Subject: [PATCH] Clean-up for both config styles if there is no more domains Fix #1458 --- func/domain.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/func/domain.sh b/func/domain.sh index 1d4b5479..c21a38a6 100644 --- a/func/domain.sh +++ b/func/domain.sh @@ -287,10 +287,12 @@ del_web_config() { fi get_web_config_lines $WEBTPL/$1/$WEB_BACKEND/$2 $conf sed -i "$top_line,$bottom_line d" $conf - - web_domain=$(grep DOMAIN $USER_DATA/web.conf |wc -l) - if [ "$web_domain" -eq '0' ]; then - sed -i "/.*\/$user\/.*$1.conf/d" /etc/$1/conf.d/vesta.conf + fi + # clean-up for both config styles if there is no more domains + web_domain=$(grep DOMAIN $USER_DATA/web.conf |wc -l) + if [ "$web_domain" -eq '0' ]; then + sed -i "/.*\/$user\/.*/d" /etc/$1/conf.d/vesta.conf + if [ -f "$conf" ]; then rm -f $conf fi fi