Skip to content

Commit

Permalink
fixed missing ssl certificate on restore
Browse files Browse the repository at this point in the history
  • Loading branch information
serghey-rodin committed Jun 7, 2013
1 parent 6d23a8c commit 423fcef
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions bin/v-restore-user
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 423fcef

Please sign in to comment.