Skip to content

Instantly share code, notes, and snippets.

@Brianetta
Last active November 29, 2019 12:03
Show Gist options
  • Select an option

  • Save Brianetta/0b40760b9090d38993e9a9a88fbcc06f to your computer and use it in GitHub Desktop.

Select an option

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
Copy Markdown

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