diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/wordpress.sh.erb | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/templates/wordpress.sh.erb b/templates/wordpress.sh.erb index cfcbd9e..05ab928 100644 --- a/templates/wordpress.sh.erb +++ b/templates/wordpress.sh.erb @@ -78,22 +78,32 @@ function wordpress_upgrade { cp -a wordpress-$old/$file wordpress-$new/ fi done + + # Extra folders for extra_folder in $extra_folders; do if [ -d ../wordpress-$old/$extra_folder ]; then cp -Rp ../wordpress-$old/$extra_folder . fi done - # Exclusions - exclude_plugins="--exclude=akismet --exclude=hello.php --exclude=index.php" - exclude_themes="--exclude=index.php --exclude=twentytwelve --exclude=twentyeleven --exclude=twentyten" - - # Files, Plugins and Themes + # Files rsync -av wordpress-$old/wp-content/uploads/ wordpress-$new/wp-content/uploads/ rsync -av wordpress-$old/wp-content/blogs.dir/ wordpress-$new/wp-content/blogs.dir/ - rsync -av $exclude_plugins wordpress-$old/wp-content/plugins/ wordpress-$new/wp-content/plugins/ - rsync -av $exclude_themes wordpress-$old/wp-content/themes/ wordpress-$new/wp-content/themes/ - + + # Plugins + for plugin in `ls wordpress-$old/wp-content/plugins/`; do + if [ ! -e "wordpress-$new/wp-content/plugins/$plugin" ]; then + cp -r wordpress-$old/wp-content/plugins/$plugin wordpress-$new/wp-content/plugins/ + fi + done + + # Themes + for theme in `ls wordpress-$old/wp-content/themes/`; do + if [ ! -e "wordpress-$new/wp-content/themes/$theme" ]; then + cp -r wordpress-$old/wp-content/themes/$theme wordpress-$new/wp-content/themes/ + fi + done + # Fix permissions chown -R root.root wordpress-$new/wp-content/{plugins,themes} |