From 423fcef77bc822bcd394bb28509bc3d2c1beb6d5 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Fri, 7 Jun 2013 11:50:40 +0300 Subject: [PATCH] fixed missing ssl certificate on restore --- bin/v-restore-user | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/bin/v-restore-user b/bin/v-restore-user index 02ac7b599..b8663876c 100755 --- a/bin/v-restore-user +++ b/bin/v-restore-user @@ -288,6 +288,14 @@ if [ "$web" != 'no' ]; then str="$str TIME='$(date +%T)' DATE='$(date +%F)'" echo $str >> $USER_DATA/web.conf + # Copy ssl certificate + if [ "$SSL" = 'yes' ]; then + for crt in $(ls $tmpdir/web/$domain/conf |grep ssl); do + crt=$(echo "$crt" |sed "s/ssl.//") + cp -f $tmpdir/web/$domain/conf/ssl.$crt $USER_DATA/ssl/$crt + done + fi + # Rebuild web config rebuild_web_domain_conf @@ -303,7 +311,7 @@ if [ "$web" != 'no' ]; then fi # Adding SSL vhost - if [ "$ssl_change" = 'yes' ]; then + if [ "$SSL" = 'yes' ]; then tmp_conf="$HOMEDIR/$user/conf/web/tmp_s$WEB_SYSTEM.conf" conf="$HOMEDIR/$user/conf/web/s$WEB_SYSTEM.conf" cat $tmp_conf >> $conf @@ -316,7 +324,7 @@ if [ "$web" != 'no' ]; then # Adding proxy vhost proxy_conf="/etc/$PROXY_SYSTEM/conf.d/vesta.conf" - if [ "$proxy_change" = 'yes' ]; then + if [ ! -z "$PROXY" ]; then tmp_conf="$HOMEDIR/$user/conf/web/tmp_$PROXY_SYSTEM.conf" conf="$HOMEDIR/$user/conf/web/$PROXY_SYSTEM.conf" cat $tmp_conf >> $conf @@ -328,7 +336,7 @@ if [ "$web" != 'no' ]; then fi # Adding SSL proxy vhost - if [ "$proxy_change" = 'yes' ] && [ "$ssl_change" = 'yes' ]; then + if [ ! -z "$PROXY" ] && [ "$SSL" = 'yes' ]; then tmp_conf="$HOMEDIR/$user/conf/web/tmp_s$PROXY_SYSTEM.conf" conf="$HOMEDIR/$user/conf/web/s$PROXY_SYSTEM.conf" cat $tmp_conf >> $conf