summaryrefslogtreecommitdiff
path: root/src/monkeysphere
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2008-09-02 21:24:33 -0400
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>2008-09-02 21:24:33 -0400
commit0352609ba566585484da022b6512520629b9981f (patch)
treec2812c04ec77623aa3bfedba48c0c3ce80276cde /src/monkeysphere
parentf4e9793240c11fbbd699b697370281f20bd7a89d (diff)
tuning how monkeysphere looks for secret keys.
Diffstat (limited to 'src/monkeysphere')
-rwxr-xr-xsrc/monkeysphere4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/monkeysphere b/src/monkeysphere
index 92beafd..471da20 100755
--- a/src/monkeysphere
+++ b/src/monkeysphere
@@ -93,7 +93,7 @@ gen_subkey(){
if [ -z "$1" ] ; then
# find all secret keys
- keyID=$(gpg --with-colons --list-secret-keys | grep ^sec | cut -f5 -d:)
+ keyID=$(gpg --with-colons --list-secret-keys | grep ^sec | cut -f5 -d: | sort -u)
# if multiple sec keys exist, fail
if (( $(echo "$keyID" | wc -l) > 1 )) ; then
echo "Multiple secret keys found:"
@@ -115,7 +115,7 @@ key before joining the monkeysphere. You can do this with:
# fail if multiple sec lines are returned, which means the id
# given is not unique
- if [ $(echo "$gpgOut" | grep '^sec:' | wc -l) -gt '1' ] ; then
+ if [ $(echo "$gpgOut" | grep -c '^sec:') -gt '1' ] ; then
failure "Key ID '$keyID' is not unique."
fi