Skip to content

Instantly share code, notes, and snippets.

@tluyben
Created March 10, 2019 09:17
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 tluyben/1bd753a0c9c86941ba730ad77301171c to your computer and use it in GitHub Desktop.
Save tluyben/1bd753a0c9c86941ba730ad77301171c to your computer and use it in GitHub Desktop.
automatically update wp
#!/bin/bash
export PATH=/usr/local/wp-cli/bin:$PATH
[[ $@ =~ ^\/home\/(.*?)\/www ]];
cp updatewp_user.sh $@
cd $@
echo $@
chown -R ${BASH_REMATCH[1]}.${BASH_REMATCH[1]} .
su ${BASH_REMATCH[1]} -c "cd $@; ./updatewp_user.sh"
rm $@/updatewp_user.sh
#!/bin/bash
wp core update
wp core update-db
wp plugin update-all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment