Skip to content

Instantly share code, notes, and snippets.

@morganestes
Created March 17, 2020 20:12
Show Gist options
  • Select an option

  • Save morganestes/bd6732a7f2d246e1c32aaafd82eadf36 to your computer and use it in GitHub Desktop.

Select an option

Save morganestes/bd6732a7f2d246e1c32aaafd82eadf36 to your computer and use it in GitHub Desktop.
Check network for sites with active plugin
#!/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