Skip to content

Commit 9acef2c

Browse files
committed
Fix v-restore
1 parent 7ed3141 commit 9acef2c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

bin/v-restore-user

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ if [ "$mail" != 'no' ] && [ ! -z "$MAIL_SYSTEM" ]; then
505505

506506
# Unpacking domain container
507507
tar xf $BACKUP/$backup -C $tmpdir ./mail/$domain
508-
echo "$domain"
508+
509509
if [ "$?" -ne 0 ]; then
510510
rm -rf $tmpdir
511511
error="Can't unpack $domain mail container"
@@ -602,12 +602,12 @@ if [ "$mail" != 'no' ] && [ ! -z "$MAIL_SYSTEM" ]; then
602602

603603
domain_idn=$domain
604604
format_domain_idn
605-
exit
605+
606606
# Restoring emails
607607
if [ $backup_mode = 'zstd' ]; then
608608
if [ -e "$tmpdir/mail/$domain/accounts.tar.zst" ]; then
609-
# Current Hestia store email in the $HOMEDIR/$user/mail/$domain
610-
chmod u+w "$HOMEDIR/$user/mail/$domain"
609+
# Current Hestia store email in the $HOMEDIR/$user/mail/$domain_idn
610+
chmod u+w "$HOMEDIR/$user/mail/$domain_idn"
611611
$BIN/v-extract-fs-archive "$user" "$tmpdir/mail/$domain/accounts.tar.zst" "$HOMEDIR/$user/mail/$domain_idn/"
612612
if [ "$?" -ne 0 ]; then
613613
rm -rf $tmpdir
@@ -618,12 +618,12 @@ if [ "$mail" != 'no' ] && [ ! -z "$MAIL_SYSTEM" ]; then
618618
fi
619619

620620
# Chowning as owner needs to be user:mail instead of user:user
621-
find $HOMEDIR/$user/mail/$domain -user $user \
621+
find $HOMEDIR/$user/mail/$domain_idn -user $user \
622622
-exec chown -h $user:mail {} \;
623623
fi
624624
else
625625
if [ -e "$tmpdir/mail/$domain/accounts.tar.gz" ]; then
626-
chmod u+w "$HOMEDIR/$user/mail/$domain"
626+
chmod u+w "$HOMEDIR/$user/mail/$domain_idn"
627627
$BIN/v-extract-fs-archive "$user" "$tmpdir/mail/$domain/accounts.tar.gz" "$HOMEDIR/$user/mail/$domain_idn/"
628628
if [ "$?" -ne 0 ]; then
629629
rm -rf $tmpdir
@@ -634,12 +634,12 @@ if [ "$mail" != 'no' ] && [ ! -z "$MAIL_SYSTEM" ]; then
634634
fi
635635

636636
# Chowning as owner needs to be user:mail instead of user:user
637-
find $HOMEDIR/$user/mail/$domain -user $user \
637+
find $HOMEDIR/$user/mail/$domain_idn -user $user \
638638
-exec chown -h $user:mail {} \;
639639
fi
640640
fi
641641
# Chowning mail conf files to exim user
642-
find $HOMEDIR/$user/conf/mail/$domain_idn -user root \
642+
find $HOMEDIR/$user/conf/mail/$domain -user root \
643643
-exec chown $exim_user {} \;
644644

645645
done

0 commit comments

Comments
 (0)