0
|
1 #!/bin/bash
|
|
2
|
|
3 g++ -c dnsbl.cpp
|
8
|
4 if [ $? -ne 0 ]; then
|
|
5 echo "compiler errors"
|
|
6 exit
|
|
7 fi
|
0
|
8 g++ -o dnsbl dnsbl.o /usr/lib/libresolv.a -lmilter -pthread
|
8
|
9 if [ $? -ne 0 ]; then
|
|
10 echo "linker errors"
|
|
11 exit
|
|
12 fi
|
|
13
|
0
|
14 if [ "$1" == "comp" ]; then
|
|
15 exit
|
|
16 fi
|
|
17
|
|
18 # build the test.cf file
|
|
19 make test.cf
|
|
20
|
|
21 # start the milter
|
|
22 pid=/var/run/dnsbl.pid
|
|
23 echo start the milter
|
|
24 mkdir -p /var/run/dnsbl
|
|
25 chmod 700 /var/run/dnsbl
|
|
26 mv -f $pid $pid.save
|
|
27 rm -f /var/run/dnsbl/dnsbl.sock
|
9
|
28 ./dnsbl -p local:/var/run/dnsbl/dnsbl.sock
|
8
|
29 sleep 5
|
|
30 P2=`cat $pid`
|
|
31 mv -f $pid.save $pid
|
|
32 echo started dnsbl milter as process $P2
|
0
|
33
|
8
|
34 /usr/lib/sendmail -bd -Ctest.cf -Ldnsbl
|
|
35 sleep 5
|
|
36 P3=`head -1 /var/run/sm-test.pid`
|
|
37 echo started sendmail as process $P3
|
|
38
|
|
39 echo eventually "'"kill -KILL $P2 $P3"'"
|
|
40
|