summaryrefslogtreecommitdiffstats
path: root/scripts/service-add-with-cert.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/service-add-with-cert.sh')
-rwxr-xr-xscripts/service-add-with-cert.sh24
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