Mercurial > dnsbl
annotate test.bash @ 113:a893afee4b80 stable-5-11
move to autoconf/automake/docbook
author | carl |
---|---|
date | Tue, 20 Dec 2005 17:35:16 -0800 |
parents | c3e9fa6b37c6 |
children |
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 |
105 | 38 make -f Makefile.test 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 |