X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=src%2Fmonkeysphere;h=92beafd64e5a73d3e946659ba7b67ca90b179924;hb=e987c4c4cd94fea8b44b39f800ecd2a94712f7d0;hp=da10c204e5ca9cb86dbec3c19666e40ed09f064e;hpb=f12a516aa8dce8d1e951f3c47481abe960366f5b;p=monkeysphere.git diff --git a/src/monkeysphere b/src/monkeysphere index da10c20..92beafd 100755 --- a/src/monkeysphere +++ b/src/monkeysphere @@ -4,6 +4,8 @@ # # 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 # or later. @@ -32,7 +34,7 @@ umask 077 ######################################################################## usage() { - cat <&2 usage: $PGRM [options] [args] MonkeySphere client tool. @@ -144,7 +146,7 @@ save EOF ) - log "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" & @@ -153,7 +155,7 @@ EOF rm -rf "$fifoDir" wait - log "done." + log verbose "done." } function subkey_to_ssh_agent() { @@ -279,6 +281,7 @@ mkdir -p -m 0700 "$MONKEYSPHERE_HOME" # set empty config variables with ones from the environment, or from # config file, or with defaults +LOG_LEVEL=${MONKEYSPHERE_LOG_LEVEL:=${LOG_LEVEL:="INFO"}} GNUPGHOME=${MONKEYSPHERE_GNUPGHOME:=${GNUPGHOME:="${HOME}/.gnupg"}} KEYSERVER=${MONKEYSPHERE_KEYSERVER:="$KEYSERVER"} # if keyserver not specified in env or monkeysphere.conf, @@ -304,6 +307,7 @@ REQUIRED_USER_KEY_CAPABILITY=${MONKEYSPHERE_REQUIRED_USER_KEY_CAPABILITY:="a"} # permissions export GNUPGHOME mkdir -p -m 0700 "$GNUPGHOME" +export LOG_LEVEL # get subcommand COMMAND="$1" @@ -330,7 +334,7 @@ case $COMMAND in else # exit if the known_hosts file does not exist if [ ! -e "$KNOWN_HOSTS" ] ; then - log "known_hosts file '$KNOWN_HOSTS' does not exist." + log error "known_hosts file '$KNOWN_HOSTS' does not exist." exit fi @@ -354,7 +358,7 @@ case $COMMAND in # exit if the authorized_user_ids file is empty if [ ! -e "$AUTHORIZED_USER_IDS" ] ; then - log "authorized_user_ids file '$AUTHORIZED_USER_IDS' does not exist." + log error "authorized_user_ids file '$AUTHORIZED_USER_IDS' does not exist." exit fi