summaryrefslogtreecommitdiff
blob: 206a95d1cd16bfac6e8809fd3aeb458a5bdf5c6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
BASE_DIR="/var/www/blogs.gentoo.org" # created by cfengine
REPO="${BASE_DIR}/blogs-gentoo"

# Get latest Git changes
pushd ${BASE_DIR}/blogs-gentoo > /dev/null
git reset --hard origin/master > /dev/null 2>&1
git pull --force > /dev/null 2>&1
popd > /dev/null

# Rsync the plugins folder from the repo inside wp-content
rsync -avz --delete-after ${REPO}/plugins/ ${BASE_DIR}/htdocs/wp-content/plugins > /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
THEMES=(
    wp-oxygen
    kde-breathe
    kde-graffiti
)

for THEME in ${THEMES[@]} ; do
    [[ -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