|
|
@@ -307,34 +307,32 @@ del_web_config() {
|
|
|
fi
|
|
|
|
|
|
# Remove domain configuration files and clean up symbolic links
|
|
|
- rm -f /etc/$WEB_SYSTEM/conf.d/domains/$domain.conf
|
|
|
- rm -f /etc/$WEB_SYSTEM/conf.d/domains/$domain.ssl.conf
|
|
|
+ if [ ! -z "$WEB_SYSTEM" ]; then
|
|
|
+ rm -f /etc/$WEB_SYSTEM/conf.d/domains/$domain.conf
|
|
|
+ rm -f /etc/$WEB_SYSTEM/conf.d/domains/$domain.ssl.conf
|
|
|
+ fi
|
|
|
if [ ! -z "$PROXY_SYSTEM" ]; then
|
|
|
rm -f /etc/$PROXY_SYSTEM/conf.d/domains/$domain.conf
|
|
|
rm -f /etc/$PROXY_SYSTEM/conf.d/domains/$domain.ssl.conf
|
|
|
fi
|
|
|
|
|
|
# Clean up legacy configuration files
|
|
|
- if [ -e "$conf" ]; then
|
|
|
- if [[ "$2" =~ stpl$ ]]; then
|
|
|
- rm -f /etc/$WEB_SYSTEM/conf.d/domains/$domain.ssl.conf
|
|
|
- else
|
|
|
- rm -f /etc/$WEB_SYSTEM/conf.d/domains/$domain.conf
|
|
|
- fi
|
|
|
- rm -f $conf
|
|
|
- else
|
|
|
- # fallback to old style configs
|
|
|
+ if [ ! -e "$conf" ]; then
|
|
|
conf="$HOMEDIR/$user/conf/web/$1.conf"
|
|
|
if [[ "$2" =~ stpl$ ]]; then
|
|
|
conf="$HOMEDIR/$user/conf/web/s$1.conf"
|
|
|
fi
|
|
|
get_web_config_lines $WEBTPL/$1/$WEB_BACKEND/$2 $conf
|
|
|
sed -i "$top_line,$bottom_line d" $conf
|
|
|
+
|
|
|
+ # Remove old global includes file
|
|
|
+ rm -f /etc/$1/conf.d/hestia.conf
|
|
|
fi
|
|
|
- # clean-up for both config styles if there is no more domains
|
|
|
+
|
|
|
+ # Clean up user web.conf file if no more domains exist
|
|
|
web_domain=$(grep DOMAIN $USER_DATA/web.conf |wc -l)
|
|
|
if [ "$web_domain" -eq '0' ]; then
|
|
|
- sed -i "/.*\/$user\/conf\/web\//d" /etc/$1/conf.d/hestia.conf
|
|
|
+ sed -i "/.*\/$user\/conf\/web\//d"
|
|
|
if [ -f "$conf" ]; then
|
|
|
rm -f $conf
|
|
|
fi
|