Explorar o código

update file ownership on domain migration

Serghey Rodin %!s(int64=12) %!d(string=hai) anos
pai
achega
263df1cc0e
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  1. 8 0
      bin/v-change-domain-owner

+ 8 - 0
bin/v-change-domain-owner

@@ -87,6 +87,10 @@ if [ ! -z "$web_data" ]; then
     # Move data
     # Move data
     mv $HOMEDIR/$owner/web/$domain $HOMEDIR/$user/web/
     mv $HOMEDIR/$owner/web/$domain $HOMEDIR/$user/web/
 
 
+    # Change ownership
+    find $HOMEDIR/$user/web/$domain -user $owner \
+        -exec chown -h $user:$user {} \;
+
     # Rebuild config
     # Rebuild config
     $BIN/v-unsuspend-web-domain $user $domain no >> /dev/null 2>&1
     $BIN/v-unsuspend-web-domain $user $domain no >> /dev/null 2>&1
     $BIN/v-rebuild-web-domains $owner no
     $BIN/v-rebuild-web-domains $owner no
@@ -144,6 +148,10 @@ if [ ! -z "$mail_data" ]; then
     # Move data
     # Move data
     mv $HOMEDIR/$owner/mail/$domain $HOMEDIR/$user/mail/
     mv $HOMEDIR/$owner/mail/$domain $HOMEDIR/$user/mail/
 
 
+    # Change ownership
+    find $HOMEDIR/$user/mail/$domain -user $owner \
+        -exec chown -h $user {} \;
+
     # Rebuild config
     # Rebuild config
     $BIN/v-unsuspend-mail-domain $user $domain no >> /dev/null 2>&1
     $BIN/v-unsuspend-mail-domain $user $domain no >> /dev/null 2>&1
     $BIN/v-rebuild-mail-domains $owner no
     $BIN/v-rebuild-mail-domains $owner no