#!/bin/sh WORDPRESS_TEMP="/var/tmp/wordpress" WORDPRESS_INSTALL="/var/www" cd /root/wordpress if [ -f "latest.tar.gz" ]; then rm "latest.tar.gz" fi if [ ! -f "$WORDPRESS_TEMP" ]; then mkdir $WORDPRESS_TEMP fi wget http://wordpress.org/latest.tar.gz echo -n "Extracting archive to ${WORDPRESS_TEMP}... " tar -xzf latest.tar.gz -C ${WORDPRESS_TEMP} if [ $? -ne 0 ]; then echo "FAILED" exit $? else echo "DONE" fi #echo -n "Patching wordpress themes... " #patch -s -p0 ${WORDPRESS_TEMP}/wordpress/wp-includes/theme.php < wp-theme.diff #if [ $? -ne 0 ]; then # echo "FAILED" # exit $? #else # echo "DONE" #fi echo "Installing wordpress into ${WORDPRESS_INSTALL}..." cp -R ${WORDPRESS_TEMP}/wordpress ${WORDPRESS_INSTALL} if [ $? -ne 0 ]; then echo "FAILED" exit $? else echo "DONE" fi cd /root # Copy themes to users #echo "Copying themes to users... " #for x in `find /home -iname "blog"`; do # echo -n "Copying $x ... " # cp -R ${WORDPRESS_INSTALL}/wp-content/themes $x # if [ $? -ne 0 ]; then # echo "FAILED" # exit $? # else # echo "DONE" # fi #done