forked from iwestlin/gd-utils
-
Notifications
You must be signed in to change notification settings - Fork 38
/
sa.sh
38 lines (35 loc) · 1.29 KB
/
sa.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env bash
#=============================================================
# https://github.com/roshanconnor123/gd-utils
# File Name: sa.sh
# Author: roshanconnor
# Description:Downloading service accounts
# System Required: Debian/Ubuntu
#=============================================================
cecho() {
local code="\033["
case "$1" in
black | bk) color="${code}0;30m";;
red | r) color="${code}1;31m";;
green | g) color="${code}1;32m";;
yellow | y) color="${code}1;33m";;
blue | b) color="${code}1;34m";;
purple | p) color="${code}1;35m";;
cyan | c) color="${code}1;36m";;
gray | gr) color="${code}0;37m";;
*) local text="$1"
esac
[ -z "$text" ] && local text="$color$2${code}0m"
echo -e "$text"
}
# ★★★Downloading Service accounts★★★
echo && cecho r "Downloading the service accounts from your private repo"
echo "Provide github username"
read username
echo "Provide github password"
read Password
cd ~
git clone https://"$username":"$Password"@github.com/"$username"/accounts
cp accounts/*.json gd-utils/sa/
cecho b "Service accounts are added to Gdutils"
exit