X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=src%2Fmonkeysphere;h=e8ca9e2b08d4c7ca8c23fef1495cdba22c41bb92;hb=a06fe8d31d992b6d57fd12fa615718580a6b62c4;hp=92beafd64e5a73d3e946659ba7b67ca90b179924;hpb=fccf552603e35a3b7419d0d6925c03ab24576ee9;p=monkeysphere.git diff --git a/src/monkeysphere b/src/monkeysphere index 92beafd..e8ca9e2 100755 --- a/src/monkeysphere +++ b/src/monkeysphere @@ -17,7 +17,7 @@ SHARE=${MONKEYSPHERE_SHARE:-"/usr/share/monkeysphere"} export SHARE . "${SHARE}/common" || exit 1 -# date in UTF format if needed +# UTC date in ISO 8601 format if needed DATE=$(date -u '+%FT%T') # unset some environment variables that could screw things up @@ -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 @@ -273,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