Skip to content

Instantly share code, notes, and snippets.

@stewil87
Created February 1, 2018 16:30
Show Gist options
  • Save stewil87/1b11712ec3ea25e7329f1110f4582297 to your computer and use it in GitHub Desktop.
Save stewil87/1b11712ec3ea25e7329f1110f4582297 to your computer and use it in GitHub Desktop.
Download and extract latest Wordpress Release in specified or script directory
#!/bin/bash
read -p "Enter install path. if empty, will use path of this script: " SCRIPTPATH
if [ -z "$SCRIPTPATH" ]; then
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
fi
echo Download latest Wordpress
wget -P $SCRIPTPATH https://wordpress.org/latest.tar.gz
echo Unpacking Wordpress
tar -xzvf $SCRIPTPATH/latest.tar.gz
echo Move files from Wordpress
mv -v $SCRIPTPATH/wordpress/* $SCRIPTPATH
echo Delete Wordpress riginal files
rmdir $SCRIPTPATH/wordpress
rm $SCRIPTPATH/latest.tar.gz
echo done
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment