Skip to content

Commit 423fcef

Browse files
committed
fixed missing ssl certificate on restore
1 parent 6d23a8c commit 423fcef

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

bin/v-restore-user

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,14 @@ if [ "$web" != 'no' ]; then
288288
str="$str TIME='$(date +%T)' DATE='$(date +%F)'"
289289
echo $str >> $USER_DATA/web.conf
290290

291+
# Copy ssl certificate
292+
if [ "$SSL" = 'yes' ]; then
293+
for crt in $(ls $tmpdir/web/$domain/conf |grep ssl); do
294+
crt=$(echo "$crt" |sed "s/ssl.//")
295+
cp -f $tmpdir/web/$domain/conf/ssl.$crt $USER_DATA/ssl/$crt
296+
done
297+
fi
298+
291299
# Rebuild web config
292300
rebuild_web_domain_conf
293301

@@ -303,7 +311,7 @@ if [ "$web" != 'no' ]; then
303311
fi
304312

305313
# Adding SSL vhost
306-
if [ "$ssl_change" = 'yes' ]; then
314+
if [ "$SSL" = 'yes' ]; then
307315
tmp_conf="$HOMEDIR/$user/conf/web/tmp_s$WEB_SYSTEM.conf"
308316
conf="$HOMEDIR/$user/conf/web/s$WEB_SYSTEM.conf"
309317
cat $tmp_conf >> $conf
@@ -316,7 +324,7 @@ if [ "$web" != 'no' ]; then
316324

317325
# Adding proxy vhost
318326
proxy_conf="/etc/$PROXY_SYSTEM/conf.d/vesta.conf"
319-
if [ "$proxy_change" = 'yes' ]; then
327+
if [ ! -z "$PROXY" ]; then
320328
tmp_conf="$HOMEDIR/$user/conf/web/tmp_$PROXY_SYSTEM.conf"
321329
conf="$HOMEDIR/$user/conf/web/$PROXY_SYSTEM.conf"
322330
cat $tmp_conf >> $conf
@@ -328,7 +336,7 @@ if [ "$web" != 'no' ]; then
328336
fi
329337

330338
# Adding SSL proxy vhost
331-
if [ "$proxy_change" = 'yes' ] && [ "$ssl_change" = 'yes' ]; then
339+
if [ ! -z "$PROXY" ] && [ "$SSL" = 'yes' ]; then
332340
tmp_conf="$HOMEDIR/$user/conf/web/tmp_s$PROXY_SYSTEM.conf"
333341
conf="$HOMEDIR/$user/conf/web/s$PROXY_SYSTEM.conf"
334342
cat $tmp_conf >> $conf

0 commit comments

Comments
 (0)