Guest User

Untitled

a guest
May 20th, 2018
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. dir=~/projects
  4. num=0
  5. [[ -n "$*" ]] && sites=$* || sites=$(ls $dir)
  6. for site in $sites; do
  7. if [ -d "$dir/$site/wp" -a -f "$dir/$site/wp-config.php" ]; then
  8. echo -e "\e[1;33mUpdate \e[36m$site\e[0m\e[0m"
  9. cd $dir/$site/wp/ && wp core update && wp plugin update --all
  10. let num=num+1
  11. fi
  12. done
  13. if [ $num = 0 ]; then
  14. echo -e "\e[1;37;41mUpdated nothing!\e[0m"
  15. else
  16. echo -e "\e[1;37;42mUpdated $num sites!\e[0m"
  17. fi
  18. exit 0
Add Comment
Please, Sign In to add comment