-
Notifications
You must be signed in to change notification settings - Fork 0
/
create-employees.sh
executable file
·44 lines (33 loc) · 1.08 KB
/
create-employees.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
39
40
41
42
43
44
#!/bin/bash
set -o pipefail -o errexit -o nounset
gam="$HOME/bin/gamadv-xtd3/gam"
if [ ! -x "$gam" ] ; then
echo "Need https://github.com/taers232c/GAMADV-XTD3 in $gam, please install"
exit 98
fi
source config.sh
test "$MASTERSHEET"
test "$MASTERUSER"
test "$STARTPASSWORD"
test "$NOTIFICATIONUSERS"
source _functions.sh
info Create employee accounts
# https://github.com/taers232c/GAMADV-XTD3/wiki/Users#create-a-user
$gam loop gsheet "$MASTERUSER" "$MASTERSHEET" "gam Mitarbeiter neu" \
gam create user "~Email" \
password "$STARTPASSWORD" \
ou "~OU" \
firstname "~Vorname" \
lastname "~Nachname" \
changepasswordatnextlogin true \
notify "$NOTIFICATIONUSERS" \
subject "Neues JTS Konto #givenname# #familyname#" \
file new-employee-notification.txt
info Waiting a bit for Google to settle down
for x in $(seq 1 10) ; do echo -n ". "; sleep 1 ; done; echo
./maintenance.sh
cat <<EOF
*** Done
Please update groups and make sure to run ./maintenance.sh at the end
You can now remove the "Neu" tag from these new users.
EOF