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
52
53
|
#!/bin/bash
FIXTURE_DIR=$1
INIT_FILE=$FIXTURE_DIR/ipa_init.json
usage(){
echo "$0 {FIXTURE_DIR}"
exit 1
}
if [ ! -f $INIT_FILE ]
then
usage
exit 1
fi
json="{
\"method\": \"batch\",
\"params\": [
[
{
\"method\": \"i18n_messages\",
\"params\": [[], {}]
},
{
\"method\": \"user_find\",
\"params\":[[], { \"whoami\": true, \"all\": true }]
},
{
\"method\": \"env\",
\"params\": [[], {}]
},
{
\"method\": \"dns_is_enabled\",
\"params\": [[], {}]
}
],
{}
]
}"
curl -v\
-H "Content-Type: application/json"\
-H "Accept: applicaton/json"\
-H "Referer: https://`hostname`/ipa/xml"\
--negotiate\
--delegation always\
-u :\
--cacert /etc/ipa/ca.crt\
-d "$json"\
-X POST\
https://`hostname`/ipa/json | sed 's/[ \t]*$//' > $INIT_FILE
|