X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fmonkeysphere;h=b0003fc3c71c137fd4556c97bc475ff57aa50437;hb=1e26301ec4cd2afc45c968c3fe3d77bf296b03fb;hp=d585bfddeb9137d99e7cab111f9410d49073247c;hpb=426e933f733339e1bc787be0a56c179015b07b13;p=monkeysphere.git diff --git a/src/monkeysphere b/src/monkeysphere index d585bfd..b0003fc 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 @@ -33,7 +34,7 @@ umask 077 ######################################################################## usage() { - cat <&2 usage: $PGRM [options] [args] MonkeySphere client tool. @@ -145,7 +146,7 @@ save EOF ) - log "generating subkey..." + log info "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 "done." + log info "done." } function subkey_to_ssh_agent() { @@ -280,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, @@ -305,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" @@ -331,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 @@ -355,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