mirror of
https://github.com/myvesta/vesta
synced 2025-08-21 05:44:08 -07:00
Fix backup
This commit is contained in:
parent
668da0178e
commit
37a2525ab0
2 changed files with 85 additions and 26 deletions
|
@ -147,34 +147,82 @@ if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB" != '*' ]; then
|
|||
conf="$USER_DATA/web.conf"
|
||||
grep "DOMAIN='$domain'" $conf > vesta/web.conf
|
||||
|
||||
# Backup vhost config
|
||||
tpl_file="$WEBTPL/$WEB_SYSTEM/$WEB_BACKEND/$TPL.tpl"
|
||||
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
|
||||
|
||||
# Backup ssl vhost
|
||||
if [ "$SSL" = 'yes' ]; then
|
||||
tpl_file="$WEBTPL/$WEB_SYSTEM/$WEB_BACKEND/$TPL.stpl"
|
||||
conf="$HOMEDIR/$user/conf/web/s$WEB_SYSTEM.conf"
|
||||
if [ ! -z "$IP" ]; then
|
||||
old="$IP"
|
||||
# Backup vhost config
|
||||
tpl_file="$WEBTPL/$WEB_SYSTEM/$WEB_BACKEND/$TPL.tpl"
|
||||
conf="$HOMEDIR/$user/conf/web/$WEB_SYSTEM.conf"
|
||||
get_web_config_lines $tpl_file $conf
|
||||
sed -n "$top_line,$bottom_line p" $conf > conf/s$WEB_SYSTEM.conf
|
||||
sed -n "$top_line,$bottom_line p" $conf > conf/$WEB_SYSTEM.conf
|
||||
|
||||
# Backup ssl vhost
|
||||
if [ "$SSL" = 'yes' ]; then
|
||||
tpl_file="$WEBTPL/$WEB_SYSTEM/$WEB_BACKEND/$TPL.stpl"
|
||||
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
|
||||
fi
|
||||
|
||||
# Backup proxy config
|
||||
if [ ! -z "$PROXY_SYSTEM" ] && [ ! -z "$PROXY" ]; then
|
||||
tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.tpl"
|
||||
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
|
||||
fi
|
||||
|
||||
# Backup ssl proxy config
|
||||
if [ ! -z "$PROXY_SYSTEM" ] && [ "$SSL" = 'yes' ]; then
|
||||
tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.stpl"
|
||||
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
|
||||
fi
|
||||
fi
|
||||
|
||||
# Backup proxy config
|
||||
if [ ! -z "$PROXY_SYSTEM" ] && [ ! -z "$PROXY" ]; then
|
||||
tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.tpl"
|
||||
conf="$HOMEDIR/$user/conf/web/$PROXY_SYSTEM.conf"
|
||||
if [ ! -z "$IP6" ]; then
|
||||
if [ -z "$IP" ]; then
|
||||
echo "" > conf/$WEB_SYSTEM.conf
|
||||
if [ "$SSL" = 'yes' ]; then
|
||||
echo "" > conf/s$WEB_SYSTEM.conf
|
||||
fi
|
||||
if [ ! -z "$PROXY_SYSTEM" ] && [ ! -z "$PROXY" ]; then
|
||||
echo "" > conf/$PROXY_SYSTEM.conf
|
||||
fi
|
||||
if [ ! -z "$PROXY_SYSTEM" ] && [ "$SSL" = 'yes' ]; then
|
||||
echo > conf/s$PROXY_SYSTEM.conf
|
||||
fi
|
||||
fi
|
||||
old=$IP6
|
||||
# Backup vhost config
|
||||
tpl_file="$WEBTPL/$WEB_SYSTEM/$WEB_BACKEND/$TPL.tpl"
|
||||
conf="$HOMEDIR/$user/conf/web/$WEB_SYSTEM.conf"
|
||||
get_web_config_lines $tpl_file $conf
|
||||
sed -n "$top_line,$bottom_line p" $conf > conf/$PROXY_SYSTEM.conf
|
||||
fi
|
||||
sed -n "$top_line,$bottom_line p" $conf >> conf/$WEB_SYSTEM.conf
|
||||
|
||||
# Backup ssl proxy config
|
||||
if [ ! -z "$PROXY_SYSTEM" ] && [ "$SSL" = 'yes' ]; then
|
||||
tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.stpl"
|
||||
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
|
||||
# Backup ssl vhost
|
||||
if [ "$SSL" = 'yes' ]; then
|
||||
tpl_file="$WEBTPL/$WEB_SYSTEM/$WEB_BACKEND/$TPL.stpl"
|
||||
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
|
||||
fi
|
||||
|
||||
# Backup proxy config
|
||||
if [ ! -z "$PROXY_SYSTEM" ] && [ ! -z "$PROXY" ]; then
|
||||
tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.tpl"
|
||||
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
|
||||
fi
|
||||
|
||||
# Backup ssl proxy config
|
||||
if [ ! -z "$PROXY_SYSTEM" ] && [ "$SSL" = 'yes' ]; then
|
||||
tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.stpl"
|
||||
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
|
||||
fi
|
||||
fi
|
||||
|
||||
# Backup custom config
|
||||
|
|
|
@ -492,13 +492,16 @@ if [ "$dns" != 'no' ] && [ ! -z "$DNS_SYSTEM" ]; then
|
|||
old_ip=$IP
|
||||
IP=$ip
|
||||
fi
|
||||
|
||||
# Checking ipv6 address
|
||||
check_ipv6=$(is_ipv6_valid $IP6 $user)
|
||||
if [ ! -z "$check_ipv6" ]; then
|
||||
local_ip6=''
|
||||
get_user_ipv6 $user
|
||||
old_ipv6=$IP6
|
||||
IP=$ipv6
|
||||
IP6=$ipv6
|
||||
else
|
||||
old_ipv6=''
|
||||
fi
|
||||
|
||||
# Checking dns template
|
||||
|
@ -516,6 +519,14 @@ if [ "$dns" != 'no' ] && [ ! -z "$DNS_SYSTEM" ]; then
|
|||
|
||||
# Restoring dns records
|
||||
cp -f $tmpdir/dns/$domain/vesta/$domain.conf $USER_DATA/dns/
|
||||
if [ -z "$old_ipv6" ] && [ ! -z "$IP6" ]; then
|
||||
time_n_date=$(date +'%T %F')
|
||||
time=$(echo "$time_n_date" |cut -f 1 -d \ )
|
||||
date=$(echo "$time_n_date" |cut -f 2 -d \ )
|
||||
ip=""
|
||||
ipv6="$IP6"
|
||||
add_dns_config_records
|
||||
fi
|
||||
|
||||
# Rebuilding dns domain
|
||||
rebuild_dns_domain_conf
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue