Skip to content

Commit 4885d61

Browse files
authored
Delete web files if they exist before restore.
2 parents ae94595 + 8a8899e commit 4885d61

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

bin/v-restore-user

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# info: restore user
33
# options: USER BACKUP [WEB] [DNS] [MAIL] [DB] [CRON] [UDIR] [NOTIFY]
44
#
5-
# The function for resotring user from backup.
5+
# The function for restoring user from backup.
66

77

88
#----------------------------------------------------------#
@@ -399,6 +399,9 @@ if [ "$web" != 'no' ] && [ ! -z "$WEB_SYSTEM" ]; then
399399
fi
400400

401401
# Restoring web domain data
402+
if [ -d "$HOMEDIR/$user/web/$domain/public_html" ]; then
403+
rm -rf $HOMEDIR/$user/web/$domain/public_html/*
404+
fi
402405
tar -xzpf $tmpdir/web/$domain/domain_data.tar.gz \
403406
-C $HOMEDIR/$user/web/$domain/
404407
if [ "$?" -ne 0 ]; then

0 commit comments

Comments
 (0)