X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=src%2Fmonkeysphere;h=59cb3d6ac45764e255fa1135f2eecdee24ca5541;hb=b7a13e19393e347ba66196a49e972d722d7d4780;hp=da72c9a1c906a6af9c4ff6457730a07b52645439;hpb=5bb8d410b08bf36d1ff3f36257ac364080d80aa9;p=monkeysphere.git diff --git a/src/monkeysphere b/src/monkeysphere index da72c9a..59cb3d6 100755 --- a/src/monkeysphere +++ b/src/monkeysphere @@ -4,6 +4,7 @@ # # The monkeysphere scripts are written by: # Jameson Rollins +# Jamie McClelland # Daniel Kahn Gillmor # # They are Copyright 2008, and are all released under the GPL, version 3 @@ -92,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:" @@ -114,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 @@ -145,7 +146,7 @@ save EOF ) - log info "generating subkey..." + log verbose "generating subkey..." fifoDir=$(mktemp -d) (umask 077 && mkfifo "$fifoDir/pass") echo "$editCommands" | gpg --passphrase-fd 3 3< "$fifoDir/pass" --expert --command-fd 0 --edit-key "$keyID" & @@ -154,7 +155,7 @@ EOF rm -rf "$fifoDir" wait - log info "done." + log verbose "done." } function subkey_to_ssh_agent() { @@ -272,7 +273,7 @@ unset AUTHORIZED_KEYS [ -r "${ETC}/monkeysphere.conf" ] && . "${ETC}/monkeysphere.conf" # set monkeysphere home directory -MONKEYSPHERE_HOME=${MONKEYSPHERE_HOME:="${HOME}/.config/monkeysphere"} +MONKEYSPHERE_HOME=${MONKEYSPHERE_HOME:="${HOME}/.monkeysphere"} mkdir -p -m 0700 "$MONKEYSPHERE_HOME" # load local config