diff options
Diffstat (limited to 'scripts/service-add-with-cert.sh')
-rwxr-xr-x | scripts/service-add-with-cert.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/scripts/service-add-with-cert.sh b/scripts/service-add-with-cert.sh new file mode 100755 index 0000000..41b2d8d --- /dev/null +++ b/scripts/service-add-with-cert.sh @@ -0,0 +1,24 @@ +#!/bin/sh +x + +cert=`cat example.b64` + +url="https://dev.example.com/ipa/json" +#url="http://localhost:8888/ipa/json" + +json="{ + \"method\": \"service_add\", + \"params\": [ + [ \"test/dev.example.com@DEV.EXAMPLE.COM\" ], + { \"usercertificate\": { \"__base64__\": \"$cert\" } } + ], + \"id\":0 +}"\ + +curl\ + -H "Content-Type:application/json"\ + -H "Accept:applicaton/json"\ + --negotiate -u :\ + --cacert /etc/ipa/ca.crt\ + -d "$json"\ + -X POST\ + $url |