Skip to content

Instantly share code, notes, and snippets.

@wlkns
Created December 1, 2021 10:26
Show Gist options
  • Select an option

  • Save wlkns/f68710b50af0a18a6b86d366f5012e8c to your computer and use it in GitHub Desktop.

Select an option

Save wlkns/f68710b50af0a18a6b86d366f5012e8c to your computer and use it in GitHub Desktop.
Install Wordpress Utility
#!/bin/bash
if [ $# -eq 0 ]
then
echo "Please provide installation directory as first parameter e.g. $BASH_SOURCE <dir>"
exit 1
fi
if [ -d $1 ]; then
echo 'Insallation (folder) already exists!'
exit 1
fi
echo "Downloading..."
wget -q https://wordpress.org/latest.tar.gz -O wordpress-latest.tar.gz
echo "Extracting..."
mkdir -m 777 "$1"
tar -zxf wordpress-latest.tar.gz --strip-components=1 -C "$1/"
rm wordpress-latest.tar.gz
echo "Done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment