Skip to content

Commit d942f85

Browse files
authored
Clean-up for both config styles if there is no more domains
Fix hestiacp#1458
1 parent 7ec123a commit d942f85

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

func/domain.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,12 @@ del_web_config() {
287287
fi
288288
get_web_config_lines $WEBTPL/$1/$WEB_BACKEND/$2 $conf
289289
sed -i "$top_line,$bottom_line d" $conf
290-
291-
web_domain=$(grep DOMAIN $USER_DATA/web.conf |wc -l)
292-
if [ "$web_domain" -eq '0' ]; then
293-
sed -i "/.*\/$user\/.*$1.conf/d" /etc/$1/conf.d/vesta.conf
290+
fi
291+
# clean-up for both config styles if there is no more domains
292+
web_domain=$(grep DOMAIN $USER_DATA/web.conf |wc -l)
293+
if [ "$web_domain" -eq '0' ]; then
294+
sed -i "/.*\/$user\/.*/d" /etc/$1/conf.d/vesta.conf
295+
if [ -f "$conf" ]; then
294296
rm -f $conf
295297
fi
296298
fi

0 commit comments

Comments
 (0)