annotate test.bash @ 76:81f1e400e8ab

start coding on new config syntax
author carl
date Sat, 16 Jul 2005 13:47:19 -0700
parents b7449114ebb0
children 946fc1bcfb2c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
96a9758165cd Initial revision
carl
parents:
diff changeset
1 #!/bin/bash
96a9758165cd Initial revision
carl
parents:
diff changeset
2
14
443aa0e8c6fa changes suggested by Nigel Horne
carl
parents: 13
diff changeset
3 ############################
443aa0e8c6fa changes suggested by Nigel Horne
carl
parents: 13
diff changeset
4 ## compile and run the test program
443aa0e8c6fa changes suggested by Nigel Horne
carl
parents: 13
diff changeset
5 ##
443aa0e8c6fa changes suggested by Nigel Horne
carl
parents: 13
diff changeset
6 #g++ -c test.cpp
443aa0e8c6fa changes suggested by Nigel Horne
carl
parents: 13
diff changeset
7 #if [ $? -ne 0 ]; then
443aa0e8c6fa changes suggested by Nigel Horne
carl
parents: 13
diff changeset
8 # echo "compiler errors"
443aa0e8c6fa changes suggested by Nigel Horne
carl
parents: 13
diff changeset
9 # exit
443aa0e8c6fa changes suggested by Nigel Horne
carl
parents: 13
diff changeset
10 #fi
443aa0e8c6fa changes suggested by Nigel Horne
carl
parents: 13
diff changeset
11 #g++ -o test test.o -pthread
443aa0e8c6fa changes suggested by Nigel Horne
carl
parents: 13
diff changeset
12 #if [ $? -ne 0 ]; then
443aa0e8c6fa changes suggested by Nigel Horne
carl
parents: 13
diff changeset
13 # echo "linker errors"
443aa0e8c6fa changes suggested by Nigel Horne
carl
parents: 13
diff changeset
14 # exit
443aa0e8c6fa changes suggested by Nigel Horne
carl
parents: 13
diff changeset
15 #fi
13
2752e512fd32 finish documentation
carl
parents: 9
diff changeset
16
2752e512fd32 finish documentation
carl
parents: 9
diff changeset
17
2752e512fd32 finish documentation
carl
parents: 9
diff changeset
18 ###########################
2752e512fd32 finish documentation
carl
parents: 9
diff changeset
19 # compile the milter
2752e512fd32 finish documentation
carl
parents: 9
diff changeset
20 #
76
81f1e400e8ab start coding on new config syntax
carl
parents: 74
diff changeset
21
81f1e400e8ab start coding on new config syntax
carl
parents: 74
diff changeset
22 if [ "$1" == "build" ]; then
81f1e400e8ab start coding on new config syntax
carl
parents: 74
diff changeset
23 rm -f dnsbl.o scanner.o context.o tokenizer.o
81f1e400e8ab start coding on new config syntax
carl
parents: 74
diff changeset
24 g++ -c -pthread dnsbl.cpp scanner.cpp context.cpp tokenizer.cpp
81f1e400e8ab start coding on new config syntax
carl
parents: 74
diff changeset
25 if [ $? -ne 0 ]; then
81f1e400e8ab start coding on new config syntax
carl
parents: 74
diff changeset
26 echo "compiler errors"
81f1e400e8ab start coding on new config syntax
carl
parents: 74
diff changeset
27 exit
81f1e400e8ab start coding on new config syntax
carl
parents: 74
diff changeset
28 fi
81f1e400e8ab start coding on new config syntax
carl
parents: 74
diff changeset
29 g++ -o dnsbl dnsbl.o scanner.o context.o tokenizer.o /usr/lib/libresolv.a -lmilter -pthread
81f1e400e8ab start coding on new config syntax
carl
parents: 74
diff changeset
30 if [ $? -ne 0 ]; then
81f1e400e8ab start coding on new config syntax
carl
parents: 74
diff changeset
31 echo "linker errors"
81f1e400e8ab start coding on new config syntax
carl
parents: 74
diff changeset
32 exit
81f1e400e8ab start coding on new config syntax
carl
parents: 74
diff changeset
33 fi
8
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
34 fi
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
35
0
96a9758165cd Initial revision
carl
parents:
diff changeset
36 if [ "$1" == "comp" ]; then
96a9758165cd Initial revision
carl
parents:
diff changeset
37 exit
96a9758165cd Initial revision
carl
parents:
diff changeset
38 fi
96a9758165cd Initial revision
carl
parents:
diff changeset
39
96a9758165cd Initial revision
carl
parents:
diff changeset
40 # build the test.cf file
96a9758165cd Initial revision
carl
parents:
diff changeset
41 make test.cf
96a9758165cd Initial revision
carl
parents:
diff changeset
42
96a9758165cd Initial revision
carl
parents:
diff changeset
43 # start the milter
96a9758165cd Initial revision
carl
parents:
diff changeset
44 pid=/var/run/dnsbl.pid
96a9758165cd Initial revision
carl
parents:
diff changeset
45 echo start the milter
96a9758165cd Initial revision
carl
parents:
diff changeset
46 mkdir -p /var/run/dnsbl
59
510a511ad554 Add resolver processes to allow better performance on busy machines
carl
parents: 43
diff changeset
47 chmod 700 /var/run/dnsbl
43
acbe44bbba22 seems to drop root privs ok now
carl
parents: 37
diff changeset
48 chown dnsbl:dnsbl /var/run/dnsbl
0
96a9758165cd Initial revision
carl
parents:
diff changeset
49 mv -f $pid $pid.save
60
390ed250c5d2 use local unix domain socket for resolver process communication
carl
parents: 59
diff changeset
50 ./dnsbl -d -r /var/run/dnsbl/dnsbl.resolver.sock2 -p local:/var/run/dnsbl/dnsbl.sock2
8
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
51 sleep 5
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
52 P2=`cat $pid`
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
53 mv -f $pid.save $pid
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
54 echo started dnsbl milter as process $P2
0
96a9758165cd Initial revision
carl
parents:
diff changeset
55
8
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
56 /usr/lib/sendmail -bd -Ctest.cf -Ldnsbl
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
57 sleep 5
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
58 P3=`head -1 /var/run/sm-test.pid`
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
59 echo started sendmail as process $P3
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
60
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
61 echo eventually "'"kill -KILL $P2 $P3"'"
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
62