Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- dir=~/projects
- num=0
- [[ -n "$*" ]] && sites=$* || sites=$(ls $dir)
- for site in $sites; do
- if [ -d "$dir/$site/wp" -a -f "$dir/$site/wp-config.php" ]; then
- echo -e "\e[1;33mUpdate \e[36m$site\e[0m\e[0m"
- cd $dir/$site/wp/ && wp core update && wp plugin update --all
- let num=num+1
- fi
- done
- if [ $num = 0 ]; then
- echo -e "\e[1;37;41mUpdated nothing!\e[0m"
- else
- echo -e "\e[1;37;42mUpdated $num sites!\e[0m"
- fi
- exit 0
Add Comment
Please, Sign In to add comment