Skip to content

Instantly share code, notes, and snippets.

@mboynes
Forked from dlh01/distribute_user.sh
Created December 3, 2014 18:30
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 mboynes/eaf54fb9ff9843c571dd to your computer and use it in GitHub Desktop.
Save mboynes/eaf54fb9ff9843c571dd to your computer and use it in GitHub Desktop.
#!/bin/bash
# Testing changes
# Usage: ./distribute_user.sh [username] [role]
ARGS="$@"
echo "Adding user $1 as $2 to all sites"
SITES=$(wp site list --field=url --format=csv)
for site in $SITES
do
wp user set-role $1 $2 --url=$site
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment