#!/bin/sh # Wordpress Update Script # Written by: Keith Murray # Released: 2006-02-22 # Email: kdmurray # at # gmail # dot # com # Released under GPL # # This has been tested to work with Wordpress 2.0+ # Even though the script is programmed to make a backup of your blog # ensure you create a manual backup until you're sure how the script # will run against your setup. # # There is no warranty of any kind with this script. # The script author is not responsible for any consequences resulting from # the use, or inability to use this script. # # Email comments and questions are welcome! DOWNLOAD_FILE="latest.tar.gz"; DOWNLOAD_PATH="http://wordpress.org/"$DOWNLOAD_FILE; PROD_FOLDER="krell.cellsandbytes.net"; if [ "$1" = "" ]; then echo $1 else PROD_FOLDER=$1 fi echo "Downloading current version of Wordpress..."; wget $DOWNLOAD_PATH; echo "Uncompressing wordpress archive..." tar -zxvf $DOWNLOAD_FILE >> null; echo "Copying over plugins..."; cp $PROD_FOLDER/wp-content/plugins wordpress/wp-content -R; echo "Copying over themes..."; cp $PROD_FOLDER/wp-content/themes wordpress/wp-content -R; echo "Copying over uploads..."; cp $PROD_FOLDER/wp-content/uploads wordpress/wp-content -R; echo "Copying over languages..."; cp $PROD_FOLDER/wp-includes/languages wordpress/wp-includes -R; echo "Copying configuration file..."; cp $PROD_FOLDER/wp-config.php wordpress; echo "Backing up production version to "$PROD_FOLDER"_bak..."; rm -R $PROD_FOLDER"_bak"; mv $PROD_FOLDER $PROD_FOLDER"_bak"; echo "Copying over new version to "$PROD_FOLDER; mv "wordpress" $PROD_FOLDER; echo "Removing downloaded archive..."; rm latest.tar.gz echo "" echo "" echo "Wordpress upgrade is almost done!" echo "Visit the /wp-admin/upgrade.php page for your blog to complete the process." echo "" echo ""