summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo Chatzimichos <tampakrap@gentoo.org>2012-08-05 22:27:58 +0200
committerTheo Chatzimichos <tampakrap@gentoo.org>2012-08-05 22:27:58 +0200
commita571478cbd4ac1f2d5c26182ed7df582b019bdb8 (patch)
treec29f3acce2a8d22663ff860ffb81476fc0591496
parentRemove smart-youtube, jetpack provides youtube embedding support (diff)
downloadblogs-gentoo-a571478cbd4ac1f2d5c26182ed7df582b019bdb8.tar.gz
blogs-gentoo-a571478cbd4ac1f2d5c26182ed7df582b019bdb8.tar.bz2
blogs-gentoo-a571478cbd4ac1f2d5c26182ed7df582b019bdb8.zip
Some plugins mis-behave with the symlink, thus rsync instead
Add REPO var, plus some cosmetics
-rwxr-xr-xscripts/update-wordpress17
1 files changed, 9 insertions, 8 deletions
diff --git a/scripts/update-wordpress b/scripts/update-wordpress
index 96a34f15..f20053b5 100755
--- a/scripts/update-wordpress
+++ b/scripts/update-wordpress
@@ -1,18 +1,19 @@
#!/bin/bash
BASE_DIR="/var/www/blogs.gentoo.org" # created by cfengine
-
-# Create folders and symlinks
-[[ -d ${BASE_DIR}/htdocs/wp-content/plugins ]] && rm -rf ${BASE_DIR}/htdocs/wp-content/plugins
-[[ -L ${BASE_DIR}/htdocs/wp-content/plugins ]] || ln -s ${BASE_DIR}/blogs-gentoo/plugins ${BASE_DIR}/htdocs/wp-content/
+REPO="${BASE_DIR}/blogs-gentoo"
# Get latest Git changes
pushd ${BASE_DIR}/blogs-gentoo > /dev/null
+git reset --hard origin/master 2>&1
git pull --force > /dev/null 2>&1
popd > /dev/null
-# List of themes
-# In order to install a new theme, add it under themes/, then put its name in the THEMES array, and finally enable it from the admin panel
+# Rsync the plugins folder from the repo inside wp-content
+rsync -avz --delete-after ${REPO}/plugins/ ${BASE_DIR}/htdocs/wp-content/plugins
+# List of themes
+# In order to install a new theme, add it under themes/, then put
+# its name in the THEMES array, and finally enable it from the admin panel
THEMES=(
wp-oxygen
kde-breathe
@@ -20,10 +21,10 @@ THEMES=(
)
for THEME in ${THEMES[@]} ; do
- [[ -L ${BASE_DIR}/htdocs/wp-content/themes/${THEME} ]] || ln -s ${BASE_DIR}/blogs-gentoo/themes/${THEME} ${BASE_DIR}/htdocs/wp-content/themes/
+ [[ -L ${BASE_DIR}/htdocs/wp-content/themes/${THEME} ]] || \
+ ln -s ${REPO}/themes/${THEME} ${BASE_DIR}/htdocs/wp-content/themes/
done
[[ -d ${BASE_DIR}/htdocs/wp-content/blogs.dir ]] || mkdir ${BASE_DIR}/htdocs/wp-content/blogs.dir
chown apache:root ${BASE_DIR}/htdocs/wp-content/blogs.dir
chmod 744 ${BASE_DIR}/htdocs/wp-content/blogs.dir
-