summaryrefslogtreecommitdiff
path: root/localgpgcleankeyring
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2015-08-06 13:59:34 +0200
committerJonas Smedegaard <dr@jones.dk>2015-08-06 13:59:34 +0200
commit2086ba9a7ebdccb6e75361fd7a6c4ad3d9a0cf8b (patch)
treef9b90c33eff8fcb241c6fc6587d6ddf86bfdbf4d /localgpgcleankeyring
parent2b94962d5940dfeb89a4cde5c85c3c5c2cf664dd (diff)
Execute (pipe'able output is an antipattern).
Diffstat (limited to 'localgpgcleankeyring')
-rwxr-xr-xlocalgpgcleankeyring7
1 files changed, 1 insertions, 6 deletions
diff --git a/localgpgcleankeyring b/localgpgcleankeyring
index de4e078..06591c1 100755
--- a/localgpgcleankeyring
+++ b/localgpgcleankeyring
@@ -24,18 +24,13 @@ keepers=$(echo $mykeys $mysigners | tr ' ' '\012' | sort -u)
# the keepers list in egrep syntax: ^(key|key|…)
keepers_egrep=$(echo $keepers | sed 's/^/^(/; s/$/)/; s/ /|/g;')
-# show all the keepers as a comment so this script's output is shell-able
-echo '# Keepers: ' $keepers
-
# everyone who isn't on the keepers list is deleted
deleters=$(gpg --list-keys --with-colons | grep '^pub' | cut -d: -f5 | egrep -v ${keepers_egrep})
-# echo the command if there are any to delete
-# command is interactive
if
[ -z "$deleters" ]
then
echo "# Nothing to delete!"
else
- echo 'gpg --delete-keys' $deleters
+ gpg --delete-keys $deleters
fi