From 2b588323a8502a20dfafb4cf2717ce4f5cf9be69 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 13 Apr 2016 14:12:14 +0200 Subject: auch CA-Zertifikat installieren --- README | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'README') 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") -- cgit v1.2.3-70-g09d2