Created
May 15, 2017 14:05
-
-
Save sysboss/d3e26795680dd11e55faae6a984933eb to your computer and use it in GitHub Desktop.
Ultimately trust a public key non-interactively mode
This file contains hidden or 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 | |
# Provide key uid from `gpg --list-keys` | |
# Based on: https://blog.tersmitten.nl/how-to-ultimately-trust-a-public-key-non-interactively.html | |
KEY_NAME="" | |
echo "$( \ | |
gpg --list-keys --fingerprint \ | |
| grep "${KEY_NAME}" -B 1 | head -1 \ | |
| tr -d '[:space:]' | awk 'BEGIN { FS = "=" } ; { print $2 }' \ | |
):6:" | gpg --import-ownertrust; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment