File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ set -eu
3
+
4
+ SCRIPT_DIR=$( builtin cd " $( dirname ${BASH_SOURCE[0]} ) " && builtin pwd)
5
+
6
+ source " ${SCRIPT_DIR} /common.sh"
7
+
8
+ __usage="
9
+ Usage: $( basename $0 ) USER
10
+
11
+ Arguments:
12
+ USER The account in $DOMAIN (sans domain) to sign out from all sessions
13
+ "
14
+
15
+ # print usage for -? or -h or --help
16
+ if [[ " $# " -lt 1 || " $1 " =~ ^(-\? | -h| --help)$ ]]; then
17
+ echo " $__usage "
18
+ exit 0
19
+ fi
20
+
21
+ # the full account name to signout
22
+ ACCOUNT=" $1 @$DOMAIN "
23
+
24
+ # verify $ACCOUNT exists before continuing
25
+ if ! user_exists $ACCOUNT ; then
26
+ echo_ts " Account $ACCOUNT does not exist, stopping"
27
+ exit 1
28
+ else
29
+ echo_ts " Account $ACCOUNT exists, continuing..."
30
+ fi
31
+
32
+ echo_ts " Signing out $ACCOUNT from all active sessions..."
33
+
34
+ gam user $ACCOUNT signout
You can’t perform that action at this time.
0 commit comments