annotate test.bash @ 74:b7449114ebb0

start coding on new config syntax
author carl
date Sun, 10 Jul 2005 14:19:00 -0700
parents 390ed250c5d2
children 81f1e400e8ab
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 #
74
b7449114ebb0 start coding on new config syntax
carl
parents: 60
diff changeset
21 rm -f dnsbl.o scanner.o context.o tokenizer.o
b7449114ebb0 start coding on new config syntax
carl
parents: 60
diff changeset
22 g++ -c -pthread dnsbl.cpp scanner.cpp context.cpp tokenizer.cpp
8
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
23 if [ $? -ne 0 ]; then
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
24 echo "compiler errors"
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
25 exit
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
26 fi
74
b7449114ebb0 start coding on new config syntax
carl
parents: 60
diff changeset
27 g++ -o dnsbl dnsbl.o scanner.o context.o tokenizer.o /usr/lib/libresolv.a -lmilter -pthread
8
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
28 if [ $? -ne 0 ]; then
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
29 echo "linker errors"
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
30 exit
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
31 fi
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
32
0
96a9758165cd Initial revision
carl
parents:
diff changeset
33 if [ "$1" == "comp" ]; then
96a9758165cd Initial revision
carl
parents:
diff changeset
34 exit
96a9758165cd Initial revision
carl
parents:
diff changeset
35 fi
96a9758165cd Initial revision
carl
parents:
diff changeset
36
96a9758165cd Initial revision
carl
parents:
diff changeset
37 # build the test.cf file
96a9758165cd Initial revision
carl
parents:
diff changeset
38 make test.cf
96a9758165cd Initial revision
carl
parents:
diff changeset
39
96a9758165cd Initial revision
carl
parents:
diff changeset
40 # start the milter
96a9758165cd Initial revision
carl
parents:
diff changeset
41 pid=/var/run/dnsbl.pid
96a9758165cd Initial revision
carl
parents:
diff changeset
42 echo start the milter
96a9758165cd Initial revision
carl
parents:
diff changeset
43 mkdir -p /var/run/dnsbl
59
510a511ad554 Add resolver processes to allow better performance on busy machines
carl
parents: 43
diff changeset
44 chmod 700 /var/run/dnsbl
43
acbe44bbba22 seems to drop root privs ok now
carl
parents: 37
diff changeset
45 chown dnsbl:dnsbl /var/run/dnsbl
0
96a9758165cd Initial revision
carl
parents:
diff changeset
46 mv -f $pid $pid.save
60
390ed250c5d2 use local unix domain socket for resolver process communication
carl
parents: 59
diff changeset
47 ./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
48 sleep 5
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
49 P2=`cat $pid`
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
50 mv -f $pid.save $pid
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
51 echo started dnsbl milter as process $P2
0
96a9758165cd Initial revision
carl
parents:
diff changeset
52
8
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
53 /usr/lib/sendmail -bd -Ctest.cf -Ldnsbl
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
54 sleep 5
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
55 P3=`head -1 /var/run/sm-test.pid`
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
56 echo started sendmail as process $P3
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
57
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
58 echo eventually "'"kill -KILL $P2 $P3"'"
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
59