diff options
-rwxr-xr-x | localgpgcleankeyring | 7 |
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 |