Created
March 30, 2024 04:35
-
-
Save felipealfonsog/4b941a321d55d94abf9972bcb1e12f97 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
gpg --check-trustdb 2>&1| grep 'not found' | awk '{print $8}' >bad-keys.txt | |
gpg --export-ownertrust > ownertrust-gpg.txt | |
mv ~/.gnupg/trustdb.gpg ~/.gnupg/trustdb.gpg-broken | |
for KEY in `cat bad-keys.txt` ; do sed -i "/$KEY/d" ownertrust-gpg.txt ; done | |
gpg --import-ownertrust ownertrust-gpg.txt | |
rm bad-keys.txt ownertrust-gpg.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment