Skip to content

Instantly share code, notes, and snippets.

@kmwalsh
Created August 12, 2022 21:18
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 kmwalsh/40728e77d88b7fb2d9a0fd048d564c23 to your computer and use it in GitHub Desktop.
Save kmwalsh/40728e77d88b7fb2d9a0fd048d564c23 to your computer and use it in GitHub Desktop.
self-updating modified plugin
#!/bin/bash
# copy patches and update.sh to temporary directory
cp -r ./patches ~/tmp/wp-security-audit-log
cp -r ./update.sh ~/tmp/wp-security-audit-log
# get latest and unzip
curl -O https://downloads.wordpress.org/plugin/wp-security-audit-log.latest-stable.zip
unzip wp-security-audit-log.latest-stable.zip
# move to overwrite current, requires "A" keypress
cp -r wp-security-audit-log ../
# cleanup
rm wp-security-audit-log.latest-stable.zip
rm -rf wp-security-audit-log
# replace patches and update.sh back to current directory
cp -r ~/tmp/wp-security-audit-log/patches ./
cp -r ~/tmp/wp-security-audit-log/update.sh ./
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment