Mercurial > dnsbl
annotate test.bash @ 93:591edabaf196
new tlds, add verify example in sample conf file
author | carl |
---|---|
date | Wed, 21 Sep 2005 12:24:44 -0700 |
parents | 962a1f8f1d9f |
children | c3e9fa6b37c6 |
rev | line source |
---|---|
0 | 1 #!/bin/bash |
2 | |
14 | 3 ############################ |
4 ## compile and run the test program | |
5 ## | |
6 #g++ -c test.cpp | |
7 #if [ $? -ne 0 ]; then | |
8 # echo "compiler errors" | |
9 # exit | |
10 #fi | |
11 #g++ -o test test.o -pthread | |
12 #if [ $? -ne 0 ]; then | |
13 # echo "linker errors" | |
14 # exit | |
15 #fi | |
13 | 16 |
17 | |
18 ########################### | |
19 # compile the milter | |
20 # | |
76 | 21 |
22 if [ "$1" == "build" ]; then | |
23 rm -f dnsbl.o scanner.o context.o tokenizer.o | |
24 g++ -c -pthread dnsbl.cpp scanner.cpp context.cpp tokenizer.cpp | |
25 if [ $? -ne 0 ]; then | |
26 echo "compiler errors" | |
27 exit | |
28 fi | |
29 g++ -o dnsbl dnsbl.o scanner.o context.o tokenizer.o /usr/lib/libresolv.a -lmilter -pthread | |
30 if [ $? -ne 0 ]; then | |
31 echo "linker errors" | |
32 exit | |
33 fi | |
8 | 34 fi |
35 | |
90
962a1f8f1d9f
add verify statement to verify addresses with better mx host
carl
parents:
89
diff
changeset
|
36 if [ "$1" == "test" ]; then |
962a1f8f1d9f
add verify statement to verify addresses with better mx host
carl
parents:
89
diff
changeset
|
37 # build the test.cf file |
962a1f8f1d9f
add verify statement to verify addresses with better mx host
carl
parents:
89
diff
changeset
|
38 make test.cf |
0 | 39 |
90
962a1f8f1d9f
add verify statement to verify addresses with better mx host
carl
parents:
89
diff
changeset
|
40 # start the milter |
962a1f8f1d9f
add verify statement to verify addresses with better mx host
carl
parents:
89
diff
changeset
|
41 pid=/var/run/dnsbl.pid |
962a1f8f1d9f
add verify statement to verify addresses with better mx host
carl
parents:
89
diff
changeset
|
42 echo start the milter |
962a1f8f1d9f
add verify statement to verify addresses with better mx host
carl
parents:
89
diff
changeset
|
43 mkdir -p /var/run/dnsbl |
962a1f8f1d9f
add verify statement to verify addresses with better mx host
carl
parents:
89
diff
changeset
|
44 chmod 700 /var/run/dnsbl |
962a1f8f1d9f
add verify statement to verify addresses with better mx host
carl
parents:
89
diff
changeset
|
45 chown dnsbl:dnsbl /var/run/dnsbl |
962a1f8f1d9f
add verify statement to verify addresses with better mx host
carl
parents:
89
diff
changeset
|
46 mv -f $pid $pid.save |
962a1f8f1d9f
add verify statement to verify addresses with better mx host
carl
parents:
89
diff
changeset
|
47 ./dnsbl -d 10 -r /var/run/dnsbl/dnsbl.resolver.sock2 -p local:/var/run/dnsbl/dnsbl.sock2 |
962a1f8f1d9f
add verify statement to verify addresses with better mx host
carl
parents:
89
diff
changeset
|
48 sleep 5 |
962a1f8f1d9f
add verify statement to verify addresses with better mx host
carl
parents:
89
diff
changeset
|
49 P2=`cat $pid` |
962a1f8f1d9f
add verify statement to verify addresses with better mx host
carl
parents:
89
diff
changeset
|
50 mv -f $pid.save $pid |
962a1f8f1d9f
add verify statement to verify addresses with better mx host
carl
parents:
89
diff
changeset
|
51 echo started dnsbl milter as process $P2 |
0 | 52 |
90
962a1f8f1d9f
add verify statement to verify addresses with better mx host
carl
parents:
89
diff
changeset
|
53 /usr/lib/sendmail -bd -Ctest.cf -Ldnsbl |
962a1f8f1d9f
add verify statement to verify addresses with better mx host
carl
parents:
89
diff
changeset
|
54 sleep 5 |
962a1f8f1d9f
add verify statement to verify addresses with better mx host
carl
parents:
89
diff
changeset
|
55 P3=`head -1 /var/run/sm-test.pid` |
962a1f8f1d9f
add verify statement to verify addresses with better mx host
carl
parents:
89
diff
changeset
|
56 echo started sendmail as process $P3 |
8 | 57 |
90
962a1f8f1d9f
add verify statement to verify addresses with better mx host
carl
parents:
89
diff
changeset
|
58 echo eventually "'"kill -KILL $P2 $P3"'" |
8 | 59 |
90
962a1f8f1d9f
add verify statement to verify addresses with better mx host
carl
parents:
89
diff
changeset
|
60 fi |