|
|
@@ -139,25 +139,28 @@ if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB" != '*' ]; then
|
|
|
grep "DOMAIN='$domain'" $conf > hestia/web.conf
|
|
|
|
|
|
# Backup vhost config
|
|
|
- conf=$HOMEDIR/$user/conf/web/$domain.$WEB_SYSTEM.conf
|
|
|
- if [ -e "$conf" ]; then
|
|
|
- cp $conf conf/$WEB_SYSTEM.conf
|
|
|
+ if [ -e "$HOMEDIR/$user/conf/web/$domain/$WEB_SYSTEM.conf" ]; then
|
|
|
+ cp $HOMEDIR/$user/conf/web/$domain/$WEB_SYSTEM.conf* conf/
|
|
|
+ elif [ -e "$HOMEDIR/$user/conf/web/$domain.$WEB_SYSTEM.conf" ]; then
|
|
|
+ cp $HOMEDIR/$user/conf/web/$domain.$WEB_SYSTEM.conf* conf/
|
|
|
else
|
|
|
- # old style configs
|
|
|
+ # legacy format: all domain configs in single file
|
|
|
tpl_file="$WEBTPL/$WEB_SYSTEM/$WEB_BACKEND/$TPL.tpl"
|
|
|
- conf="$HOMEDIR/$user/conf/web/$domain/$WEB_SYSTEM.conf"
|
|
|
+ conf="$HOMEDIR/$user/conf/web/$WEB_SYSTEM.conf"
|
|
|
get_web_config_lines $tpl_file $conf
|
|
|
sed -n "$top_line,$bottom_line p" $conf > conf/$WEB_SYSTEM.conf
|
|
|
fi
|
|
|
|
|
|
# Backup ssl vhost
|
|
|
if [ "$SSL" = 'yes' ]; then
|
|
|
- conf=$HOMEDIR/$user/conf/web/$domain.$WEB_SYSTEM.ssl.conf
|
|
|
- if [ -e "$conf" ]; then
|
|
|
- cp $conf conf/$WEB_SYSTEM.ssl.conf
|
|
|
+ if [ -e "$HOMEDIR/$user/conf/web/$domain/$WEB_SYSTEM.ssl.conf" ]; then
|
|
|
+ cp $HOMEDIR/$user/conf/web/$domain/$WEB_SYSTEM.ssl.conf* conf/
|
|
|
+ elif [ -e "$HOMEDIR/$user/conf/web/$domain.$WEB_SYSTEM.ssl.conf" ]; then
|
|
|
+ cp $HOMEDIR/$user/conf/web/$domain.$WEB_SYSTEM.ssl.conf* conf/
|
|
|
else
|
|
|
+ # legacy format: all domain configs in single file
|
|
|
tpl_file="$WEBTPL/$WEB_SYSTEM/$WEB_BACKEND/$TPL.stpl"
|
|
|
- conf="$HOMEDIR/$user/conf/web/$domain/$WEB_SYSTEM.ssl.conf"
|
|
|
+ conf="$HOMEDIR/$user/conf/web/s$WEB_SYSTEM.conf"
|
|
|
get_web_config_lines $tpl_file $conf
|
|
|
sed -n "$top_line,$bottom_line p" $conf > \
|
|
|
conf/s$WEB_SYSTEM.conf
|
|
|
@@ -166,12 +169,14 @@ if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB" != '*' ]; then
|
|
|
|
|
|
# Backup proxy config
|
|
|
if [ ! -z "$PROXY_SYSTEM" ] && [ ! -z "$PROXY" ]; then
|
|
|
- conf=$HOMEDIR/$user/conf/web/$domain.$PROXY_SYSTEM.conf
|
|
|
- if [ -e "$conf" ]; then
|
|
|
- cp $conf conf/$PROXY_SYSTEM.conf
|
|
|
+ if [ -e "$HOMEDIR/$user/conf/web/$domain/$PROXY_SYSTEM.conf" ]; then
|
|
|
+ cp $HOMEDIR/$user/conf/web/$domain/$PROXY_SYSTEM.conf* conf/
|
|
|
+ elif [ -e "$HOMEDIR/$user/conf/web/$domain.$PROXY_SYSTEM.conf" ]; then
|
|
|
+ cp $HOMEDIR/$user/conf/web/$domain.$PROXY_SYSTEM.conf* conf/
|
|
|
else
|
|
|
+ # legacy format: all domain configs in single file
|
|
|
tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.tpl"
|
|
|
- conf="$HOMEDIR/$user/conf/web/$domain/$PROXY_SYSTEM.conf"
|
|
|
+ conf="$HOMEDIR/$user/conf/web/$PROXY_SYSTEM.conf"
|
|
|
get_web_config_lines $tpl_file $conf
|
|
|
sed -n "$top_line,$bottom_line p" $conf > \
|
|
|
conf/$PROXY_SYSTEM.conf
|
|
|
@@ -180,12 +185,14 @@ if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB" != '*' ]; then
|
|
|
|
|
|
# Backup ssl proxy config
|
|
|
if [ ! -z "$PROXY_SYSTEM" ] && [ "$SSL" = 'yes' ]; then
|
|
|
- conf=$HOMEDIR/$user/conf/web/$domain.$PROXY_SYSTEM.ssl.conf
|
|
|
- if [ -e "$conf" ]; then
|
|
|
- cp $conf conf/$PROXY_SYSTEM.ssl.conf
|
|
|
+ if [ -e "$HOMEDIR/$user/conf/web/$domain/$PROXY_SYSTEM.ssl.conf" ]; then
|
|
|
+ cp $HOMEDIR/$user/conf/web/$domain/$PROXY_SYSTEM.ssl.conf* conf/
|
|
|
+ elif [ -e "$HOMEDIR/$user/conf/web/$domain.$PROXY_SYSTEM.ssl.conf" ]; then
|
|
|
+ cp $HOMEDIR/$user/conf/web/$domain.$PROXY_SYSTEM.ssl.conf* conf/
|
|
|
else
|
|
|
+ # legacy format: all domain configs in single file
|
|
|
tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.stpl"
|
|
|
- conf="$HOMEDIR/$user/conf/web/$domain/$PROXY_SYSTEM.ssl.conf"
|
|
|
+ conf="$HOMEDIR/$user/conf/web/s$PROXY_SYSTEM.conf"
|
|
|
get_web_config_lines $tpl_file $conf
|
|
|
sed -n "$top_line,$bottom_line p" $conf >\
|
|
|
conf/s$PROXY_SYSTEM.conf
|