Created
March 17, 2020 20:12
-
-
Save morganestes/bd6732a7f2d246e1c32aaafd82eadf36 to your computer and use it in GitHub Desktop.
Check network for sites with active plugin
This file contains hidden or 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
| #!/usr/bin/env bash | |
| function check_plugin() { | |
| local pluginName="${1:-hello}" | |
| local sites="$(wp site list --field=url | xargs)" | |
| for site in sites | |
| do | |
| echo "Checking ${site}" | |
| wp plugin is-active ${pluginName} --url=${site} | |
| [ $? -eq 0 ] && echo "Active" || echo "Inactive" | |
| done | |
| } | |
| check_plugin $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment