Skip to content

Instantly share code, notes, and snippets.

@richardblondet
Created November 10, 2016 17:27
Show Gist options
  • Save richardblondet/9704ffc144a124f37f5ae4379b75c7c5 to your computer and use it in GitHub Desktop.
Save richardblondet/9704ffc144a124f37f5ae4379b75c7c5 to your computer and use it in GitHub Desktop.
Shell script for downloading Wordpress in the current directory
#!/bin/bash
# argument espanish or english
echo -n "Installing latest wordpress, choose locale (en/es): ... "
# wait for my input
# read w1
echo "default locale: en"
w1="en"
#Our vars
LOCALE=""
WORDPRESS="http://wordpress.org/"
if [ $w1 = "en" ]; then
LOCALE="latest.tar.gz"
else
LOCALE="latest-es_ES.tar.gz"
fi
# get latest english version
echo "Downloading wordpress..."
wget $WORDPRESS$LOCALE
# uncompress
echo "Uncompressing wordpress $LOCALE ..."
tar xfz $LOCALE
# Remove
echo "Removing $LOCALE ..."
rm $LOCALE
# copy all contents to current directory
echo "Taking all contents to current directory..."
cp -r wordpress/* .
echo "Removing wordpress directory..."
rm -r wordpress/
echo "Done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment