mybin

my ~/bin
git clone https://a3nm.net/git/mybin/
Log | Files | Refs | README

commit 6ea3b6caa87e112e6dac2f6877879f5b463bf70f
parent f14c360974567479f2ed0d23aac00bfded48c895
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Sun,  3 Aug 2014 18:05:24 +0200

deploy sieve folder, use config

Diffstat:
deploy-sieve | 14+++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/deploy-sieve b/deploy-sieve @@ -1,21 +1,21 @@ #!/bin/bash -# Deploy sieve script $1 to location $2 but checking it passes tests $3 -# tests are lines with space-separated mail file and target folder +# Deploy sieve folder $1 to remote location $2 but check it passes tests -SCRIPT="$1" LOCATION="$2" -TESTS="$3" +SCRIPT="$1/main.sieve" +TESTS="$1/test.dat" +CONFIG="$1/dovecot.conf" while read test do FILE=$(echo "$test" | cut -d' ' -f1) FOLDER=$(echo "$test" | cut -d' ' -f2) EXPECTED="store message in folder: $FOLDER" - if sieve-test -x "+editheader" "$SCRIPT" "$FILE" 2>&1 | + if sieve-test -c "$CONFIG" "$SCRIPT" "$FILE" 2>&1 | grep "final result: success" > /dev/null then - if sieve-test -x "+editheader" "$SCRIPT" "$FILE" 2>/dev/null | + if sieve-test -c "$CONFIG" "$SCRIPT" "$FILE" 2>/dev/null | grep "$EXPECTED" > /dev/null then continue @@ -28,5 +28,5 @@ do done < "$TESTS" echo "Passed all tests: `wc -l $TESTS`" -scp "$SCRIPT" "$LOCATION" +rsync -av "$1/" "$LOCATION/"