0
|
1 #!/bin/bash
|
|
2
|
|
3 #####################
|
|
4 # stop the milter if it is already installed
|
|
5 if [ -f /etc/rc.d/init.d/dnsbl ]; then
|
|
6 /etc/rc.d/init.d/dnsbl stop
|
|
7 rm -f /etc/rc.d/init.d/dnsbl
|
|
8 fi
|
|
9
|
|
10
|
|
11 #####################
|
|
12 # build the milter
|
14
|
13 # add compiler flags - suggested by Nigel Horne
|
|
14 g++ -c $CXXFLAGS dnsbl.cpp
|
8
|
15 if [ $? -ne 0 ]; then
|
|
16 echo "compiler errors"
|
|
17 exit
|
|
18 fi
|
0
|
19 g++ -o dnsbl dnsbl.o /usr/lib/libresolv.a -lmilter -pthread
|
8
|
20 if [ $? -ne 0 ]; then
|
|
21 echo "linker errors"
|
0
|
22 exit
|
|
23 fi
|
|
24
|
|
25
|
|
26 #####################
|
|
27 # install the milter
|
|
28 DST=/var/dnsbl
|
|
29 mkdir -p $DST
|
14
|
30 if [ ! -f $DST/dnsbl.conf ]; then
|
|
31 cp dnsbl.conf $DST
|
|
32 fi
|
5
|
33 mv -f dnsbl $DST
|
0
|
34 cp dnsbl.rc /etc/rc.d/init.d/dnsbl
|
|
35 chmod 755 /etc/rc.d/init.d/dnsbl
|
|
36 /sbin/chkconfig --add dnsbl
|
|
37 /sbin/chkconfig --level 2345 dnsbl on
|
|
38 /etc/rc.d/init.d/dnsbl start
|