-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexec.sh
executable file
·46 lines (41 loc) · 996 Bytes
/
exec.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
#!/bin/bash
SUPPORTED_IDPS="google"
get_idp() {
conf=""
for s in $SUPPORTED_IDPS; do
contains=$(echo $SDM_SCIM_IDP | grep -wq $s; echo $?)
if [ $contains -eq 0 ]; then
echo "$s"
return
fi
done
if [ "$conf" == "" ]; then
echo "google"
fi
}
cmd_flags=("-idp $(get_idp)")
if [ "$SDM_SCIM_ENABLE_RATE_LIMITER" == "true" ]; then
cmd_flags+=("-enable-rate-limiter")
fi
if [ "$SDM_SCIM_APPLY" == "true" ]; then
cmd_flags+=("-apply")
fi
if [ "$SDM_SCIM_ALL" == "true" ]; then
cmd_flags+=("-all")
fi
if [ "$SDM_SCIM_ADD" == "true" ]; then
cmd_flags+=("-add")
fi
if [ "$SDM_SCIM_UPDATE" == "true" ]; then
cmd_flags+=("-update")
fi
if [ "$SDM_SCIM_DELETE" == "true" ]; then
cmd_flags+=("-delete")
fi
if [ "$SDM_SCIM_IDP_QUERY" != "" ]; then
cmd_flags+=("-idp-query '$SDM_SCIM_IDP_QUERY'")
fi
# We need this line to properly build the command and be able to run it
echo "scim $(echo ${cmd_flags[*]})" > /run_scim.sh
chmod +x /run_scim.sh
/run_scim.sh