Permalink
Browse files

update file ownership on domain migration

  • Loading branch information...
serghey-rodin committed Apr 15, 2014
1 parent d50fa97 commit 263df1cc0e64399886448b586e0b32d901110472
Showing with 8 additions and 0 deletions.
  1. +8 −0 bin/v-change-domain-owner
@@ -87,6 +87,10 @@ if [ ! -z "$web_data" ]; then
# Move data
mv $HOMEDIR/$owner/web/$domain $HOMEDIR/$user/web/

# Change ownership
find $HOMEDIR/$user/web/$domain -user $owner \
-exec chown -h $user:$user {} \;

# Rebuild config
$BIN/v-unsuspend-web-domain $user $domain no >> /dev/null 2>&1
$BIN/v-rebuild-web-domains $owner no
@@ -144,6 +148,10 @@ if [ ! -z "$mail_data" ]; then
# Move data
mv $HOMEDIR/$owner/mail/$domain $HOMEDIR/$user/mail/

# Change ownership
find $HOMEDIR/$user/mail/$domain -user $owner \
-exec chown -h $user {} \;

# Rebuild config
$BIN/v-unsuspend-mail-domain $user $domain no >> /dev/null 2>&1
$BIN/v-rebuild-mail-domains $owner no

0 comments on commit 263df1c

Please sign in to comment.