Created
May 13, 2012 14:35
-
-
Save r2p2/2688713 to your computer and use it in GitHub Desktop.
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/sh | |
| if [ "x$#" != "x1" ] | |
| then | |
| echo "usage: $0 depth" | |
| echo "depth: " | |
| exit 0 | |
| fi | |
| depth=$1 | |
| loop=1 | |
| while [ $loop ] | |
| do | |
| if [ "$depth" -lt "1" ] | |
| then | |
| echo "level of depth reached" | |
| exit | |
| fi | |
| current_unknown_keys=$(gpg --list-sigs | grep "User ID not found" | sed 's/.*\s\([0-9A-F]*\)\s....-..-...*/\1/' | sort | uniq) | |
| if [ $(echo "$current_unknown_keys" | wc -l) -ne "0" ] | |
| then | |
| for key in $current_unknown_keys | |
| do | |
| echo "fetching key $key" | |
| gpg --keyserver "hkp://pool.sks-keyservers.net" --recv-key $key 1> /dev/null 2>/dev/null | |
| done | |
| else | |
| loop=0 | |
| fi | |
| depth=$(expr $depth - 1) | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment