summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2016-04-13 14:12:14 +0200
committerErich Eckner <git@eckner.net>2016-04-13 14:12:14 +0200
commit2b588323a8502a20dfafb4cf2717ce4f5cf9be69 (patch)
tree47ff2a68aecaea1f6638d22a985055ed866f4ab6
parentc78af27f50e3f3072549a98433bf802dc08bcb5c (diff)
downloadarchMirrorBootStrap-2b588323a8502a20dfafb4cf2717ce4f5cf9be69.tar.xz
auch CA-Zertifikat installieren
-rwxr-xr-xREADME17
1 files changed, 16 insertions, 1 deletions
diff --git a/README b/README
index 75341c4..e543ec5 100755
--- a/README
+++ b/README
@@ -1,7 +1,22 @@
#!/bin/bash
# to be run as root ...
-set -o
+set -e
+
+# check and possibly install root-certificate
+if ! curl -o /dev/null "https://jeti100.ioq.uni-jena.de/" 2> /dev/null
+then
+ cert="$(curl -o - "http://jeti100.ioq.uni-jena.de/statisch/ca.crt" 2> /dev/null)"
+ if ! echo "${cert}" | \
+ sha512sum | \
+ grep -q "^c1a9da72183ef6fd87deb506dd93ea3e6247d28ec0720914c97a80369e9e81cb7e9f7ce37fe063756880eb84f402fec20ccb3c2c4fb46f5f707a022f803372be -\$"
+ then
+ >&2 echo 'falsches CA-Zertifikat heruntergeladen'
+ exit 1
+ fi
+ echo "${cert}" > /usr/share/ca-certificates/trust-source/anchors/jeti100.crt
+ trust export-compat
+fi
# import keys:
pacman-key --add <(curl -o - "https://arch.eckner.net/archlinuxewe/masterkeys.gpg")