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 #
|
0
|
21 g++ -c dnsbl.cpp
|
8
|
22 if [ $? -ne 0 ]; then
|
|
23 echo "compiler errors"
|
|
24 exit
|
|
25 fi
|
0
|
26 g++ -o dnsbl dnsbl.o /usr/lib/libresolv.a -lmilter -pthread
|
8
|
27 if [ $? -ne 0 ]; then
|
|
28 echo "linker errors"
|
|
29 exit
|
|
30 fi
|
|
31
|
0
|
32 if [ "$1" == "comp" ]; then
|
|
33 exit
|
|
34 fi
|
|
35
|
|
36 # build the test.cf file
|
|
37 make test.cf
|
|
38
|
|
39 # start the milter
|
|
40 pid=/var/run/dnsbl.pid
|
|
41 echo start the milter
|
|
42 mkdir -p /var/run/dnsbl
|
|
43 chmod 700 /var/run/dnsbl
|
|
44 mv -f $pid $pid.save
|
|
45 rm -f /var/run/dnsbl/dnsbl.sock
|
16
|
46 ./dnsbl -d -p local:/var/run/dnsbl/dnsbl.sock
|
8
|
47 sleep 5
|
|
48 P2=`cat $pid`
|
|
49 mv -f $pid.save $pid
|
|
50 echo started dnsbl milter as process $P2
|
0
|
51
|
8
|
52 /usr/lib/sendmail -bd -Ctest.cf -Ldnsbl
|
|
53 sleep 5
|
|
54 P3=`head -1 /var/run/sm-test.pid`
|
|
55 echo started sendmail as process $P3
|
|
56
|
|
57 echo eventually "'"kill -KILL $P2 $P3"'"
|
|
58
|