2011-05-12 11:50:11 -05:00
|
|
|
#!/bin/bash
|
2011-04-01 10:56:09 -05:00
|
|
|
|
|
|
|
FIXTURE_DIR=$1
|
|
|
|
|
|
|
|
INIT_FILE=$FIXTURE_DIR/ipa_init.json
|
|
|
|
|
|
|
|
usage(){
|
2011-05-12 11:50:11 -05:00
|
|
|
echo "$0 {FIXTURE_DIR}"
|
|
|
|
exit 1
|
2011-04-01 10:56:09 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
if [ ! -f $INIT_FILE ]
|
|
|
|
then
|
2011-05-12 11:50:11 -05:00
|
|
|
usage
|
|
|
|
exit 1
|
2011-04-01 10:56:09 -05:00
|
|
|
fi
|
|
|
|
|
2011-10-24 18:18:10 -05:00
|
|
|
json="{
|
|
|
|
\"method\": \"batch\",
|
|
|
|
\"params\": [
|
|
|
|
[
|
|
|
|
{
|
|
|
|
\"method\": \"i18n_messages\",
|
|
|
|
\"params\": [[], {}]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
\"method\": \"user_find\",
|
|
|
|
\"params\":[[], { \"whoami\": true, \"all\": true }]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
\"method\": \"env\",
|
|
|
|
\"params\": [[], {}]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
\"method\": \"dns_is_enabled\",
|
|
|
|
\"params\": [[], {}]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
{}
|
|
|
|
]
|
|
|
|
}"
|
2011-04-01 10:56:09 -05:00
|
|
|
|
2011-08-23 21:51:31 -05:00
|
|
|
curl -v\
|
|
|
|
-H "Content-Type: application/json"\
|
|
|
|
-H "Accept: applicaton/json"\
|
2012-01-31 13:41:28 -06:00
|
|
|
-H "Referer: https://`hostname`/ipa/xml"\
|
2011-08-23 21:51:31 -05:00
|
|
|
--negotiate\
|
|
|
|
--delegation always\
|
|
|
|
-u :\
|
|
|
|
--cacert /etc/ipa/ca.crt\
|
2011-10-24 18:18:10 -05:00
|
|
|
-d "$json"\
|
2011-08-23 21:51:31 -05:00
|
|
|
-X POST\
|
|
|
|
https://`hostname`/ipa/json | sed 's/[ \t]*$//' > $INIT_FILE
|