Skip to content

Instantly share code, notes, and snippets.

@ToX82
Created February 13, 2018 09:49
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/98747348e4ace0d06b240744961baf40 to your computer and use it in GitHub Desktop.
Save ToX82/98747348e4ace0d06b240744961baf40 to your computer and use it in GitHub Desktop.
In a folder containing multiple wordpress installations, it cycles all of the websites and updates core, plugins and themes
#!/bin/bash
echo "Updating wp-cli to its latest version..."
sudo wp cli update
echo ""
for d in */ ; do
user=$(stat -c '%U' $d)
echo ""
echo "Entering $d with user $user..."
cd $d
sudo -u $user wp core update
sudo -u $user wp plugin update --all
sudo -u $user wp theme update --all
cd ..
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment