Skip to content

Instantly share code, notes, and snippets.

@Brianetta
Last active November 29, 2019 12:03
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Brianetta/0b40760b9090d38993e9a9a88fbcc06f to your computer and use it in GitHub Desktop.
Save Brianetta/0b40760b9090d38993e9a9a88fbcc06f to your computer and use it in GitHub Desktop.
Leave all Keybase teams not listed in the file `kbteams.txt`
#!/bin/bash
TEAMS=kbteams.txt
for unwanted_team in $(
keybase team list-memberships | cut -f 1 -d ' ' | tail -n +2 | grep -v -f <(awk '{print "^" $0 "$"}' $TEAMS)
)
do
echo Leaving team $unwanted_team
keybase team leave $unwanted_team
done
#!/bin/bash
keybase team list-memberships | cut -f 1 -d ' ' | tail -n +2 > kbteams.txt
@netluxe
Copy link

netluxe commented Nov 29, 2019

thanks for this, mate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment