summaryrefslogtreecommitdiff
path: root/localgpgcleankeyring
diff options
context:
space:
mode:
Diffstat (limited to 'localgpgcleankeyring')
-rwxr-xr-xlocalgpgcleankeyring6
1 files changed, 3 insertions, 3 deletions
diff --git a/localgpgcleankeyring b/localgpgcleankeyring
index 0662135..0be9c67 100755
--- a/localgpgcleankeyring
+++ b/localgpgcleankeyring
@@ -4,7 +4,7 @@
# origin: https://scruss.com/blog/2013/05/12/clean-up-your-gnupg-keyring/
# my key should probably be the first secret key listed
-mykey=$(gpg --list-secret-keys | grep '^sec' | cut -c 13-20 | head -1)
+mykey=$(gpg --list-secret-keys --with-colons | grep '^sec' | cut -d: -f5 | head -1)
if
[ -z $mykey ]
then
@@ -14,7 +14,7 @@ then
fi
# all of the people who have signed my key
-mysigners=$(gpg --list-sigs $mykey | grep '^sig' | cut -c 14-21 | sort -u)
+mysigners=$(gpg --list-sigs --with-colons $mykey | grep '^sig' | cut -d: -f5 | sort -u)
# keep all of the signers, plus my key (if I haven't self-signed)
keepers=$(echo $mykey $mysigners | tr ' ' '\012' | sort -u)
@@ -26,7 +26,7 @@ keepers_egrep=$(echo $keepers | sed 's/^/^(/; s/$/)/; s/ /|/g;')
echo '# Keepers: ' $keepers
# everyone who isn't on the keepers list is deleted
-deleters=$(gpg --list-keys | grep '^pub'| cut -c 13-20 | egrep -v ${keepers_egrep})
+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