@@ -139,25 +139,28 @@ if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB" != '*' ]; then
139139 grep " DOMAIN='$domain '" $conf > hestia/web.conf
140140
141141 # Backup vhost config
142- conf=$HOMEDIR /$user /conf/web/$domain .$WEB_SYSTEM .conf
143- if [ -e " $conf " ]; then
144- cp $conf conf/$WEB_SYSTEM .conf
142+ if [ -e " $HOMEDIR /$user /conf/web/$domain /$WEB_SYSTEM .conf" ]; then
143+ cp $HOMEDIR /$user /conf/web/$domain /$WEB_SYSTEM .conf* conf/
144+ elif [ -e " $HOMEDIR /$user /conf/web/$domain .$WEB_SYSTEM .conf" ]; then
145+ cp $HOMEDIR /$user /conf/web/$domain .$WEB_SYSTEM .conf* conf/
145146 else
146- # old style configs
147+ # legacy format: all domain configs in single file
147148 tpl_file=" $WEBTPL /$WEB_SYSTEM /$WEB_BACKEND /$TPL .tpl"
148- conf=" $HOMEDIR /$user /conf/web/$domain / $ WEB_SYSTEM .conf"
149+ conf=" $HOMEDIR /$user /conf/web/$WEB_SYSTEM .conf"
149150 get_web_config_lines $tpl_file $conf
150151 sed -n " $top_line ,$bottom_line p" $conf > conf/$WEB_SYSTEM .conf
151152 fi
152153
153154 # Backup ssl vhost
154155 if [ " $SSL " = ' yes' ]; then
155- conf=$HOMEDIR /$user /conf/web/$domain .$WEB_SYSTEM .ssl.conf
156- if [ -e " $conf " ]; then
157- cp $conf conf/$WEB_SYSTEM .ssl.conf
156+ if [ -e " $HOMEDIR /$user /conf/web/$domain /$WEB_SYSTEM .ssl.conf" ]; then
157+ cp $HOMEDIR /$user /conf/web/$domain /$WEB_SYSTEM .ssl.conf* conf/
158+ elif [ -e " $HOMEDIR /$user /conf/web/$domain .$WEB_SYSTEM .ssl.conf" ]; then
159+ cp $HOMEDIR /$user /conf/web/$domain .$WEB_SYSTEM .ssl.conf* conf/
158160 else
161+ # legacy format: all domain configs in single file
159162 tpl_file=" $WEBTPL /$WEB_SYSTEM /$WEB_BACKEND /$TPL .stpl"
160- conf=" $HOMEDIR /$user /conf/web/$domain / $ WEB_SYSTEM.ssl .conf"
163+ conf=" $HOMEDIR /$user /conf/web/s $ WEB_SYSTEM .conf"
161164 get_web_config_lines $tpl_file $conf
162165 sed -n " $top_line ,$bottom_line p" $conf > \
163166 conf/s$WEB_SYSTEM .conf
@@ -166,12 +169,14 @@ if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB" != '*' ]; then
166169
167170 # Backup proxy config
168171 if [ ! -z " $PROXY_SYSTEM " ] && [ ! -z " $PROXY " ]; then
169- conf=$HOMEDIR /$user /conf/web/$domain .$PROXY_SYSTEM .conf
170- if [ -e " $conf " ]; then
171- cp $conf conf/$PROXY_SYSTEM .conf
172+ if [ -e " $HOMEDIR /$user /conf/web/$domain /$PROXY_SYSTEM .conf" ]; then
173+ cp $HOMEDIR /$user /conf/web/$domain /$PROXY_SYSTEM .conf* conf/
174+ elif [ -e " $HOMEDIR /$user /conf/web/$domain .$PROXY_SYSTEM .conf" ]; then
175+ cp $HOMEDIR /$user /conf/web/$domain .$PROXY_SYSTEM .conf* conf/
172176 else
177+ # legacy format: all domain configs in single file
173178 tpl_file=" $WEBTPL /$PROXY_SYSTEM /$PROXY .tpl"
174- conf=" $HOMEDIR /$user /conf/web/$domain / $ PROXY_SYSTEM .conf"
179+ conf=" $HOMEDIR /$user /conf/web/$PROXY_SYSTEM .conf"
175180 get_web_config_lines $tpl_file $conf
176181 sed -n " $top_line ,$bottom_line p" $conf > \
177182 conf/$PROXY_SYSTEM .conf
@@ -180,12 +185,14 @@ if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB" != '*' ]; then
180185
181186 # Backup ssl proxy config
182187 if [ ! -z " $PROXY_SYSTEM " ] && [ " $SSL " = ' yes' ]; then
183- conf=$HOMEDIR /$user /conf/web/$domain .$PROXY_SYSTEM .ssl.conf
184- if [ -e " $conf " ]; then
185- cp $conf conf/$PROXY_SYSTEM .ssl.conf
188+ if [ -e " $HOMEDIR /$user /conf/web/$domain /$PROXY_SYSTEM .ssl.conf" ]; then
189+ cp $HOMEDIR /$user /conf/web/$domain /$PROXY_SYSTEM .ssl.conf* conf/
190+ elif [ -e " $HOMEDIR /$user /conf/web/$domain .$PROXY_SYSTEM .ssl.conf" ]; then
191+ cp $HOMEDIR /$user /conf/web/$domain .$PROXY_SYSTEM .ssl.conf* conf/
186192 else
193+ # legacy format: all domain configs in single file
187194 tpl_file=" $WEBTPL /$PROXY_SYSTEM /$PROXY .stpl"
188- conf=" $HOMEDIR /$user /conf/web/$domain / $ PROXY_SYSTEM.ssl .conf"
195+ conf=" $HOMEDIR /$user /conf/web/s $ PROXY_SYSTEM .conf"
189196 get_web_config_lines $tpl_file $conf
190197 sed -n " $top_line ,$bottom_line p" $conf > \
191198 conf/s$PROXY_SYSTEM .conf
0 commit comments