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
|
8
|
28 dir=`pwd`
|
|
29 pushd /var/dnsbl
|
|
30 echo "$dir/dnsbl -p local:/var/run/dnsbl/dnsbl.sock"
|
|
31 $dir/dnsbl -p local:/var/run/dnsbl/dnsbl.sock
|
|
32 popd
|
|
33 sleep 5
|
|
34 P2=`cat $pid`
|
|
35 mv -f $pid.save $pid
|
|
36 echo started dnsbl milter as process $P2
|
0
|
37
|
8
|
38 /usr/lib/sendmail -bd -Ctest.cf -Ldnsbl
|
|
39 sleep 5
|
|
40 P3=`head -1 /var/run/sm-test.pid`
|
|
41 echo started sendmail as process $P3
|
|
42
|
|
43 echo eventually "'"kill -KILL $P2 $P3"'"
|
|
44
|