Last active
March 3, 2020 20:48
-
-
Save n8finch/b9144cc07281383318342645bc9d54e9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Double-check you're ready to rock and roll with an update | |
read -r -p "Are you sure you want to update all specified directories? [y/N] " response | |
if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]]; then | |
#Set the array of folders | |
DIRECTORIES=( 'wordpress-default' 'wordpress-develop' ); | |
#For each item in array, run the commands | |
for dir in ${DIRECTORIES[@]} ; do | |
cd ${dir}/public_html; | |
echo ""; | |
echo ""; | |
echo "*****************************************************" ; | |
echo "UPDATING: " ${dir} " in " `pwd` ; | |
echo "*****************************************************" ; | |
echo ""; | |
echo ""; | |
wp theme update --all; | |
wp plugin update --all; | |
wp theme list; | |
wp plugin list; | |
wp core update; | |
wp checksum core; | |
wp db check; | |
echo ''; | |
echo ''; | |
echo "*****************************************************" ; | |
echo "UPDATE for ${dir} COMPLETE!" ; | |
echo "*****************************************************" ; | |
echo ''; | |
echo ''; | |
cd ../.. ; | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment