Skip to content

Instantly share code, notes, and snippets.

@jennyq
Last active August 29, 2015 14:16
Show Gist options
  • Save jennyq/1c9a70e592008e062a5c to your computer and use it in GitHub Desktop.
Save jennyq/1c9a70e592008e062a5c to your computer and use it in GitHub Desktop.
#!/bin/bash
# disable users with @schipul.com or @theassociaton.com or @theassociation.com in email
sql="update auth_user set is_superuser=false, is_staff=false, is_active=false where (email like '%@schipul.com' or email like '%@theassocation.com' or email like '%@theassociaton.com' or email like '%@theassociation.com');"
sudo -u postgres psql -d tendenci_site -c "$sql"
sql="update profiles_profile set status_detail='inactive' where user_id in (select id from auth_user where (email like '%@schipul.com' or email like '%@theassocation.com' or email like '%@theassociaton.com' or email like '%@theassociation.com'));"
sudo -u postgres psql -d tendenci_site -c "$sql"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment