From 78615bd2736fc5cc177db325866e3ff5dc427668 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Mon, 27 Mar 2017 13:34:04 +0200 Subject: First argument is a key to treat as local. --- localgpgexpandkeyring | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'localgpgexpandkeyring') 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" -- cgit v1.2.3