Skip to content

Instantly share code, notes, and snippets.

@Phlow
Last active May 25, 2020 21:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Phlow/9e16844053b01dcdbdbb to your computer and use it in GitHub Desktop.
Save Phlow/9e16844053b01dcdbdbb to your computer and use it in GitHub Desktop.
Batch Script – Download, Extract, Prepare WordPress and Plugins
# This script fetches WordPress plus some plugins with Wget,
# extracts everything, removes clutter and moves plugins into
# the right places.
#
# Option -e prints escape sequences like breaks \n
#
reset='\x1B[0m'
green='\x1b[0;32m'
yellow='\x1b[0;33m'
clear;
cd /Users/moritz/Desktop
echo -e "\n${yellow}WordPress-Downloader${reset}\n"
echo -e "Make directory ${yellow}WORDPRESS${reset}"
mkdir WORDPRESS
cd WORDPRESS
echo -e "\n${reset}// FETTCHING..."
echo -e "${yellow}"
wget --quiet --show-progress https://de.wordpress.org/latest-de_DE.zip
wget --quiet --show-progress https://downloads.wordpress.org/plugin/jetpack.zip
wget --quiet --show-progress http://downloads.wordpress.org/plugin/wordpress-seo.zip
wget --quiet --show-progress http://downloads.wordpress.org/plugin/contact-form-7.zip
echo -e "\n${reset}// UNZIPPING...\n"
for zip in *.zip
do
echo -e "${yellow}$zip${reset}..."
unzip -q $zip
rm $zip
done
echo -e "\n// ORGANISING${reset}...\n"
echo -e "${yellow}Removing${reset} unnecessary files..."
rm wordpress/readme.html wordpress/license.txt wordpress/liesmich.html;
rm wordpress/wp-content/plugins/hello.php
echo -e "${yellow}Moving${reset} plugins to wp-content/plugins/..."
mv jetpack wordpress/wp-content/plugins/
mv wordpress-seo wordpress/wp-content/plugins/
mv contact-form-7 wordpress/wp-content/plugins/
echo -e "${yellow}Moving${reset} all files one folder up..."
mv wordpress/* .
echo -e "${yellow}Remove${reset} old wordpress-folder..."
rmdir wordpress/
echo -e "\n// WordPress ${green}sucessful${reset} downloaded :)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment