Works with Dreamhost's hosting style: directories in ~
like /home/joe/blog.joe.com/
Last active
April 14, 2024 22:55
-
-
Save ozh/4260740 to your computer and use it in GitHub Desktop.
Bash script: update WordPress to latest
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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