diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2012-01-05 14:13:40 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2012-01-05 14:13:40 -0200 |
commit | 0d1dcfcfd51c53555cf736cd944ce3a3bf475b7b (patch) | |
tree | 7ef6acd5b4e8969a3cb440b72f2471d70dfc7324 | |
parent | 778c2f6d5dac1d1b2bc10fdb43ac5813dc381c82 (diff) | |
download | puppet-wordpress-0d1dcfcfd51c53555cf736cd944ce3a3bf475b7b.tar.gz puppet-wordpress-0d1dcfcfd51c53555cf736cd944ce3a3bf475b7b.tar.bz2 |
Fixing themes and plugins copy on upgrade
-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} |