Skip to content

Instantly share code, notes, and snippets.

@sysboss
Created May 15, 2017 14:05
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sysboss/d3e26795680dd11e55faae6a984933eb to your computer and use it in GitHub Desktop.
Save sysboss/d3e26795680dd11e55faae6a984933eb to your computer and use it in GitHub Desktop.
Ultimately trust a public key non-interactively mode
#!/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