Skip to content

Instantly share code, notes, and snippets.

@aamnah
Last active July 1, 2019 06:59
Show Gist options
  • Save aamnah/aa48749844fffbd42633 to your computer and use it in GitHub Desktop.
Save aamnah/aa48749844fffbd42633 to your computer and use it in GitHub Desktop.
Install WordPress via Shell
# Colors
Color_Off='\033[0m' # Color Reset
Red='\033[0;31m' # Red
Green='\033[0;32m' # Green
Yellow='\033[0;33m' # Yellow
Cyan='\033[0;36m' # Cyan
# Bold
BRed='\033[1;31m' # Red
BGreen='\033[1;32m' # Green
BYellow='\033[1;33m' # Yellow
BCyan='\033[1;36m' # Cyan
# download the latest wordpress release and extract
echo -e " ${Cyan} Downloading the latest version of WordPress.. ${Color_Off}"
wget http://wordpress.org/latest.tar.gz
echo -e "\n ${Cyan} Extracting WordPress files.. ${Color_Off}"
tar xfz latest.tar.gz
# move all files from the newly created /wordpress dir back to the original folder
echo -e "\n ${Cyan} Moving files to install folder.. ${Color_Off}"
mv wordpress/* ./
# remove the empty /wordpress dir and the downloaded tar files.
echo -e "\n ${Cyan} Cleaning up.. ${Color_Off}"
rmdir ./wordpress/
rm -f latest.tar.gz
echo -e "\n ${Green} WordPress was sucessfully copied! Don't forget to edit ${BGreen}wp-config.php ${Green}to add Database details ${Color_Off}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment