-
Notifications
You must be signed in to change notification settings - Fork 0
/
groups-maintenance.sh
executable file
·52 lines (45 loc) · 1.9 KB
/
groups-maintenance.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
45
46
47
48
49
50
51
#!/bin/bash
source _functions.sh
source config.sh
test "$MASTERSHEET"
test "$MASTERUSER"
test "$STUDENT_PARENTS_GROUP_MANAGERS"
info Update all parents groups configuration and managers
# For some strange reason the query also returns the elternvertreter group, filtering that out in GAM
parentsgroups=$($gam print groups query "email:eltern-.*" emailmatchpattern "eltern-.*")
$gam loop - gam update group "~email" <<<"$parentsgroups" \
sync manager usersonly delivery nomail users "$STUDENT_PARENTS_GROUP_MANAGERS"
parents_groupsettings=(
whocandiscovergroup all_in_domain_can_discover
whocanpostmessage all_in_domain_can_post
whocanmoderatemembers owners_and_managers
whocanmoderatecontent none
whocanjoin invited_can_join
whocanleavegroup none_can_leave
whocanviewgroup all_members_can_view
whocanviewmembership all_managers_can_view
allowexternalmembers true
)
$gam loop - gam update group "~email" <<<"$parentsgroups" \
primarylanguage de \
replyto reply_to_sender \
"${parents_groupsettings[@]}"
info Update all student groups configuration and managers
# For some strange reason the query also returns the elternvertreter group, filtering that out in GAM
studentgroups=$($gam print groups query "email:verteiler-.*" emailmatchpattern "verteiler-.*")
$gam loop - gam update group "~email" <<<"$studentgroups" \
sync manager usersonly delivery nomail users "$STUDENT_PARENTS_GROUP_MANAGERS"
student_groupsettings=(
whocandiscovergroup all_in_domain_can_discover
whocanpostmessage all_in_domain_can_post
whocanmoderatemembers none
whocanmoderatecontent none
whocanjoin invited_can_join
whocanleavegroup none_can_leave
whocanviewgroup all_members_can_view
whocanviewmembership all_in_domain_can_view
)
$gam loop - gam update group "~email" <<<"$studentgroups" \
primarylanguage de \
replyto reply_to_sender \
"${student_groupsettings[@]}"