home · contact · privacy
Add general PGP key updating script.
authorChristian Heller <c.heller@plomlompom.de>
Wed, 27 Oct 2021 18:50:31 +0000 (20:50 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Wed, 27 Oct 2021 18:50:31 +0000 (20:50 +0200)
update_key.sh [new file with mode: 0755]

diff --git a/update_key.sh b/update_key.sh
new file mode 100755 (executable)
index 0000000..23b07ca
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh
+set -e
+
+if [ "$#" -ne 1 ]; then
+  echo "Need exactly one argument: public key ID."
+  false
+fi
+gpg_key="$1"
+keyservers='keyserver.ubuntu.com pgp.surf.nl pgp.rediris.es'
+set +e
+for keyserver in $(echo "${keyservers}"); do
+    gpg --no-tty --keyserver $keyserver --send-key "${gpg_key}"
+done
+set -e