aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrhatto <rhatto>2006-10-09 18:50:14 +0000
committerrhatto <rhatto>2006-10-09 18:50:14 +0000
commit310868c09310358102b9dce1f04eee1270ad3991 (patch)
tree11535825b0af55b4a39cc9c2f65dcd8a8b07498e
parentce661454d8f8e8d31e5723cc1fd248f9aa195c6f (diff)
downloadfirma-310868c09310358102b9dce1f04eee1270ad3991.tar.gz
firma-310868c09310358102b9dce1f04eee1270ad3991.tar.bz2
admin quit exit status changed to 3; small fixes on sendkey and info commands
-rwxr-xr-xfirma16
1 files 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