summaryrefslogtreecommitdiff
path: root/localgpgexpandkeyring
diff options
context:
space:
mode:
Diffstat (limited to 'localgpgexpandkeyring')
-rwxr-xr-xlocalgpgexpandkeyring7
1 files changed, 6 insertions, 1 deletions
diff --git a/localgpgexpandkeyring b/localgpgexpandkeyring
index 0e3e027..6df0b0c 100755
--- a/localgpgexpandkeyring
+++ b/localgpgexpandkeyring
@@ -3,11 +3,16 @@
set -e
+if [ $# > 0 ]; then
+ mykeys="$1"
+ shift
+fi
+
# set e.g. GPG=gpg2 in environment to override binary to use
GPG=${GPG:-gpg}
# my keys are those with a corresponding secret key
-mykeys=$($GPG --batch --no-auto-check-trustdb --list-secret-keys --with-colons | grep '^sec' | cut -d: -f5)
+mykeys=${mykeys:-$($GPG --batch --no-auto-check-trustdb --list-secret-keys --with-colons | grep '^sec' | cut -d: -f5)}
if [ -z "$mykeys" ]; then
# exit if no key string
echo "Can't get user's key ID"