Last active

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Bash script: update WordPress to latest

View updatewp.md

Works with Dreamhost's hosting style: directories in ~ like /home/joe/blog.joe.com/

View updatewp.md
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#!/bin/bash
CURDIR=$(pwd)
SITE=$(pwd | sed -e 's|/home/[^/]*/|http://|')
echo Updating Wordpress in $CURDIR
echo 1. downloading latest build
wget -q http://wordpress.org/latest.tar.gz
echo 2. unpacking latest build
tar zxf latest.tar.gz
cd wordpress/
echo 3. replacing old files with fresh ones
tar cf - . | (cd $CURDIR; tar xf -)
echo 4. updating your blog
wget -q -O - ${SITE}/wp-admin/upgrade.php?step=1 > /dev/null
echo 5. removing unneeded files and directory
cd ..
rm -f latest.tar.gz
rm -rf wordpress/
echo 6. all done !
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.