Skip to content

Instantly share code, notes, and snippets.

@Brianetta
Last active November 29, 2019 12:03
Show Gist options
  • Save Brianetta/0b40760b9090d38993e9a9a88fbcc06f to your computer and use it in GitHub Desktop.
Save Brianetta/0b40760b9090d38993e9a9a88fbcc06f to your computer and use it in GitHub Desktop.

Revisions

  1. Brianetta revised this gist Oct 18, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion snapshot_teams.sh
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,2 @@
    #!/bin/bash
    keybase team list-memberships | cut -f 1 -d | tail -n +2 > kbteams.txt
    keybase team list-memberships | cut -f 1 -d ' ' | tail -n +2 > kbteams.txt
  2. Brianetta revised this gist Oct 14, 2019. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions snapshot_teams.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    #!/bin/bash
    keybase team list-memberships | cut -f 1 -d | tail -n +2 > kbteams.txt
  3. Brianetta created this gist Sep 28, 2019.
    11 changes: 11 additions & 0 deletions leave_teams.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    #!/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