From 310868c09310358102b9dce1f04eee1270ad3991 Mon Sep 17 00:00:00 2001 From: rhatto Date: Mon, 9 Oct 2006 18:50:14 +0000 Subject: admin quit exit status changed to 3; small fixes on sendkey and info commands --- firma | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/firma b/firma index 7986b61..32e0f03 100755 --- a/firma +++ b/firma @@ -964,7 +964,7 @@ function ListAdministration { " ;; quit) - return_code=2 + return_code=3 ;; use) echo >&2 "$1: missing arguments (try \"help\")" @@ -1295,6 +1295,7 @@ function SubscribeUsers { local -i return_code=0 local keyserver + local method if [ "$1" == "help" ]; then echo " @@ -1326,7 +1327,12 @@ function SubscribeUsers { keyserver="$2" shift fi - $GPG --keyserver $keyserver --recv-keys $2 + if CheckValidEmail $2; then + method="--search-keys" + else + method="--recv-keys" + fi + $GPG --keyserver $keyserver $method $2 return_code=$? else echo >&2 "subscribe: missing parameters: type subscribe help" @@ -1395,7 +1401,7 @@ To: $recipients" MESSAGE_BODY="$( echo -e "${PASSPHRASE}\n${MESSAGE_BODY}" | \ - $GPG_ENCRYPT --recipient $subscriber + $GPG_ENCRYPT --recipient $recipients )" AssembleMessage @@ -1432,7 +1438,7 @@ function GetSubscribersInfo { keys="$*" fi - for key in keys; do + for key in $keys; do keyid="$($GPG_LIST_KEYS --with-fingerprint $1 2> /dev/null | grep ^fpr | cut -d : -f 10)" if [ ! -z "$keyid" ]; then $GPG --list-keys $key @@ -1603,7 +1609,7 @@ case $# in -a|--admin-task) # while a quit command isn't entered (returns 2), read STDIN - while (( $EXIT_CODE != 2 )) && read -rep "Command> " STDIN; do + while (( $EXIT_CODE != 3 )) && read -rep "Command> " STDIN; do # if line is not empty or commented, process command if [[ -n "$STDIN" && "$STDIN" != "#"* ]]; then ListAdministration $STDIN -- cgit v1.2.3