Skip to content

Instantly share code, notes, and snippets.

@ToX82
Created February 13, 2018 09:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ToX82/12a75951c1f028ce363b264750ee23a9 to your computer and use it in GitHub Desktop.
Save ToX82/12a75951c1f028ce363b264750ee23a9 to your computer and use it in GitHub Desktop.
Just one shell command to install wordpress and a few plugins
#!/bin/bash
# Please note that this script downloads the italian localization of wordpress.
# Please check on line 21 if this doesn't suit you.
if [ $# -eq 0 ]; then
echo "You didn't specify in which directory you want wordpress to be installed!"
exit 1
fi
cd $1
function getPlugin {
echo " ... installing $1 ... "
sudo wget -q -O plugin.zip https://downloads.wordpress.org/plugin/$1.zip
sudo unzip -qq plugin.zip -d "wp-content/plugins"
sudo rm plugin.zip
}
OWNER=$(ls -ld | awk '{print $3}' | tail -1);
echo "Installing wordpress core..."
sudo wget -q -O wordpress.tar.gz https://it.wordpress.org/wordpress-latest-it_IT.tar.gz
sudo tar xfz wordpress.tar.gz
sudo mv wordpress/* ./
sudo rm -rf wordpress
sudo rm wordpress.tar.gz
echo "Installing plugins..."
getPlugin cookiebar
getPlugin wordpress-seo
getPlugin better-wp-security
getPlugin automatic-updater
getPlugin wp-fastest-cache
echo "Removing old themes and useless things..."
sudo rm wp-content/plugins/hello.php
sudo rm -rf wp-content/themes/twentyfifteen/
sudo rm -rf wp-content/themes/twentysixteen/
sudo chown -R $OWNER:$OWNER ./
echo "DONE!!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment