Scripts to bootstrap a development domtool environment
[hcoop/domtool2.git] / bootstrap / domtool-init-truststore
diff --git a/bootstrap/domtool-init-truststore b/bootstrap/domtool-init-truststore
new file mode 100755 (executable)
index 0000000..0c53f2a
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+# After creating CA, add certificate to the trust store.
+
+# This is its own script because root will likely not have afs tokens
+# and be unable to write to the truststore if it is stored in afs
+
+CAPATH=`../bin/domtool-config -path cert ca`
+TRUSTSTORE=`../bin/domtool-config -path cert truststore`
+
+if [ -f "$TRUSTSTORE" ]; then
+    echo "Warning: $TRUSTSTORE exists, appending new cert instead of overwriting."
+fi
+
+cat $CAPATH/ca-cert.pem >> $TRUSTSTORE