Last active
February 28, 2023 14:11
-
-
Save Cobesz/d317f34ee451b6d956118d32a07a12f5 to your computer and use it in GitHub Desktop.
Small bash script to update all wordpress webapplications - only minor updates
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 | |
array=($(ls /home/)) | |
for i in "${array[@]}"; do #loop through all users in home folder | |
if [ $i = user_1 ] || [ $i = user_2 ]; then #exclude certain users | |
echo "Skipped $1" | |
else | |
echo $i | |
cd /home/$i/<path>/<to>/<wordpress>/<dir>/* | |
echo "Starting updating of $i in the following path: $(pwd)" | |
sudo su -c "wp core update --minor && wp theme update --all && wp plugin update --minor --all --exclude=<pluginname_to_exclude>" $i | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment