Skip to content

Commit 8c81e6b

Browse files
committed
Rework hestia/vesta version check for backup restore.
1 parent 8379391 commit 8c81e6b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

bin/v-restore-user

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,21 @@ if [ "$create_user" = 'yes' ]; then
270270

271271
# Rebuilding user
272272
rebuild_user_conf
273+
else
274+
# Unpacking user container to check if hestia or vesta backup.
275+
tar xf $BACKUP/$backup -C $tmpdir ./hestia 2>/dev/null
276+
if [ "$?" -ne 0 ]; then
277+
tar xf $BACKUP/$backup -C $tmpdir ./vesta 2>/dev/null
278+
if [ "$?" -ne 0 ]; then
279+
rm -rf $tmpdir
280+
echo "Can't unpack user container" |$SENDMAIL -s "$subj" $email $notify
281+
check_result "$E_PARSING" "Can't unpack user container"
282+
else
283+
backup_system="vesta"
284+
fi
285+
else
286+
backup_system="hestia"
287+
fi
273288
fi
274289

275290
# Unpacking pam container

0 commit comments

Comments
 (0)