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
|
|
13 g++ -c dnsbl.cpp
|
8
|
14 if [ $? -ne 0 ]; then
|
|
15 echo "compiler errors"
|
|
16 exit
|
|
17 fi
|
0
|
18 g++ -o dnsbl dnsbl.o /usr/lib/libresolv.a -lmilter -pthread
|
8
|
19 if [ $? -ne 0 ]; then
|
|
20 echo "linker errors"
|
0
|
21 exit
|
|
22 fi
|
|
23
|
|
24
|
|
25 #####################
|
|
26 # install the milter
|
|
27 DST=/var/dnsbl
|
|
28 mkdir -p $DST
|
5
|
29 cp dnsbl.conf $DST
|
|
30 mv -f dnsbl $DST
|
0
|
31 cp dnsbl.rc /etc/rc.d/init.d/dnsbl
|
|
32 chmod 755 /etc/rc.d/init.d/dnsbl
|
|
33 /sbin/chkconfig --add dnsbl
|
|
34 /sbin/chkconfig --level 2345 dnsbl on
|
|
35 /etc/rc.d/init.d/dnsbl start
|