summaryrefslogtreecommitdiff
path: root/global/post-tasks.d/015cosmos-trust
diff options
context:
space:
mode:
authorLeif Johansson <leifj@sunet.se>2013-09-02 16:01:50 +0200
committerLeif Johansson <leifj@sunet.se>2013-09-02 16:01:50 +0200
commit7515782eb503152dfc3e84fee1260fb10d560df9 (patch)
treece0087dc774a156c6a74f11d3af92ef5686b4972 /global/post-tasks.d/015cosmos-trust
import
Diffstat (limited to 'global/post-tasks.d/015cosmos-trust')
-rwxr-xr-xglobal/post-tasks.d/015cosmos-trust16
1 files changed, 16 insertions, 0 deletions
diff --git a/global/post-tasks.d/015cosmos-trust b/global/post-tasks.d/015cosmos-trust
new file mode 100755
index 0000000..ad2c066
--- /dev/null
+++ b/global/post-tasks.d/015cosmos-trust
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+for k in /etc/cosmos/keys/*.pub; do
+ fp=`cosmos gpg --with-colons --with-fingerprint < $k| awk -F: '$1 == "pub" {print $5}'`
+ cosmos gpg --with-colons --fingerprint | grep -q ":$fp:" || cosmos gpg --import < $k
+done
+
+for fp in `cosmos gpg --with-colons --fingerprint | awk -F: '$1 == "pub" {print $5}'`; do
+ seen="no"
+ for k in /etc/cosmos/keys/*.pub; do
+ cosmos gpg --with-colons --with-fingerprint < $k | grep -q ":$fp:" && seen="yes"
+ done
+ if [ "x$seen" = "xno" ]; then
+ cosmos gpg --yes --batch --delete-key $fp || true
+ fi
+done