aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrhatto <rhatto>2005-08-09 02:28:10 +0000
committerrhatto <rhatto>2005-08-09 02:28:10 +0000
commitc16446eaf8cb0a23e99511910902c4e7b0a2e849 (patch)
tree12c389269afe0a16167e1b3f720ffe2fb3b46fbc
parentd514b812d1b3645315056c39ab962cf53454ac8f (diff)
downloadfirma-c16446eaf8cb0a23e99511910902c4e7b0a2e849.tar.gz
firma-c16446eaf8cb0a23e99511910902c4e7b0a2e849.tar.bz2
funcoes message_list[error] como na rev 1.20; eliminada variavel 'x' em get_gpg_message
-rwxr-xr-xfirma41
1 files changed, 9 insertions, 32 deletions
diff --git a/firma b/firma
index 0093899..d6dd140 100755
--- a/firma
+++ b/firma
@@ -96,15 +96,15 @@ function get_message {
function get_gpg_message {
signal=0
if [ ! -z "$LINES" ]; then
- x=0; n=$LINES
- for ((count=0;count<=n;count++)); do
+ n=0;
+ for ((count=0;count<=LINES;count++)); do
if [[ $signal == "0" ]] && [[ "$(echo "${MESSAGE[$count]}" | grep -v -e "-----BEGIN PGP MESSAGE-----")" == "" ]]; then
- GPG_MESSAGE[$x]=${MESSAGE[$count]}
- ((++x))
+ GPG_MESSAGE[$n]=${MESSAGE[$count]}
+ ((++n))
signal=1
elif [[ $signal == "1" ]]; then
- GPG_MESSAGE[$x]=${MESSAGE[$count]}
- ((++x))
+ GPG_MESSAGE[$n]=${MESSAGE[$count]}
+ ((++n))
if [[ "$(echo "${MESSAGE[$count]}" | grep -v -e "-----END PGP MESSAGE-----")" == "" ]]; then
signal=0
fi
@@ -131,13 +131,6 @@ function message_list {
# compose and send a message to the list
# $1: subscriber email
# sorry no identation :P
-n=4
-
-LIST_MESSAGE[0]="From: $LISTNAME\n"
-LIST_MESSAGE[1]="To: $1\n"
-LIST_MESSAGE[2]="Subject: none\n"
-LIST_MESSAGE[3]="\n"
-
echo "$PASSWD
Message from: $FROM
Subject: $SUBJECT
@@ -146,19 +139,12 @@ $DATE
$(get_gpg_stderr | grep -F 'gpg: Signature made')
$(get_gpg_stderr | grep -F 'gpg: Good signature from')
-$(echo -e "$PASSWD\n${GPG_MESSAGE[@]}" | $GPGDECRYPT 2> /dev/null)" | sed -e 's/=20$//' | $GPGENCRYPT $1 | while read STDIN; do
- LIST_MESSAGE[$n]="$STDIN\n"
- ((++n))
-done
-
-echo -e "${LIST_MESSAGE[@]}" | $MAIL $MAIL_ARGS
-
+$(echo -e "$PASSWD\n${GPG_MESSAGE[@]}" | $GPGDECRYPT 2> /dev/null)" | sed -e 's/=20$//' | $GPGENCRYPT $1 | $MAIL -r $LISTNAME $1
}
function message_list_error {
# compose and send an error message
# sorry no identation :P
-n=0
echo "$PASSWD
Message from: $FROM
Subject: [BAD SIGNATURE] $SUBJECT
@@ -167,17 +153,7 @@ $DATE
$(get_gpg_stderr | grep -F 'gpg: Signature made')
$(get_gpg_stderr | grep -F 'gpg: BAD signature from')
-$(echo -e "$PASSWD\n${GPG_MESSAGE[@]}" | $GPGDECRYPT 2> /dev/null)" | sed -e 's/=20$//' | $GPGENCRYPT $1 | while read STDIN; do
- LIST_MESSAGE[$n]="$STDIN\n"
- ((++n))
-done
-
-echo "From: $LISTNAME
-To: $1
-Subject: none
-
-$(echo -e "${LIST_MESSAGE[@]}")" | $MAIL $MAIL_ARGS
-
+$(echo -e "$PASSWD\n${GPG_MESSAGE[@]}" | $GPGDECRYPT 2> /dev/null)" | sed -e 's/=20$//' | $GPGENCRYPT $1 | $MAIL -r $LISTNAME $1
}
function message_list_return {
@@ -438,3 +414,4 @@ declare n
for array in $USED_ARRAYS; do
unset $array
done
+