diff options
-rw-r--r-- | files/wordpress.sh | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/files/wordpress.sh b/files/wordpress.sh index 773eab7..055f204 100644 --- a/files/wordpress.sh +++ b/files/wordpress.sh @@ -7,6 +7,7 @@ BASE="/var/www/data" LOCALE="-pt_BR" WP_CLI="/usr/local/bin/wp-cli" BASENAME="`basename $0`" +WHOAMI="`whoami`" # Set alternative base function wordpress_set_base { @@ -45,7 +46,10 @@ function wordpress_deploy { wget http://br.wordpress.org/wordpress-$new$LOCALE.zip unzip wordpress-$new$LOCALE.zip && rm wordpress-$new$LOCALE.zip mv wordpress wordpress-$new/ - chown -R root.root wordpress-$new/ + + if [ "$WHOAMI" == "root" ]; then + chown -R root.root wordpress-$new/ + fi } # Upgrade a wordpress instance using upstream source. @@ -107,7 +111,9 @@ function wordpress_upgrade { done # Fix permissions - chown -R root.root wordpress-$new/wp-content/{plugins,themes} + if [ "$WHOAMI" == "root" ]; then + chown -R root.root wordpress-$new/wp-content/{plugins,themes} + fi # Set sunrise symlink if [ -f "wordpress-$new/wp-content/plugins/wordpress-mu-domain-mapping/sunrise.php" ]; then |