163
|
1 #!@BASH@
|
|
2 #
|
|
3 # dnsbl This script controls the dnsbl milter daemon.
|
|
4 #
|
|
5 #
|
|
6 # chkconfig: 2345 79 31
|
|
7 # description: dnsbl is an interface between MTA and the various dns blocking lists
|
|
8 # processname: dnsbl
|
|
9 # pidfile: /var/run/dnsbl.pid
|
|
10 # Source function library.
|
|
11 #
|
|
12 . /etc/rc.d/init.d/functions
|
|
13
|
|
14 # Source networking configuration.
|
|
15 . /etc/sysconfig/network
|
|
16
|
|
17 RETVAL=0
|
|
18 # See how we were called.
|
|
19 case "$1" in
|
|
20 start)
|
|
21 # Start daemons.
|
|
22 echo -n "Starting dnsbl-milter: "
|
|
23 if [ ! -f /var/lock/subsys/dnsbl ]; then
|
|
24 cd SYSCONFDIR/dnsbl # conf file is here
|
178
|
25 DCCIFD=
|
|
26 [ -S /var/dcc/dccifd ] && DCCIFD='-b /var/dcc/dccifd'
|
|
27 SBINDIR/dnsbl -d 10 $DCCIFD -r /var/run/dnsbl/dnsbl.resolver.sock -p local:/var/run/dnsbl/dnsbl.sock
|
163
|
28 RETVAL=$?
|
|
29 pid=`pidof -s SBINDIR/dnsbl`
|
|
30 if [ $pid ]
|
|
31 then
|
|
32 success "Starting dnsbl milter:"
|
|
33 touch /var/lock/subsys/dnsbl
|
|
34 echo
|
|
35 else
|
|
36 failure "Starting dnsbl milter:"
|
|
37 echo
|
|
38 fi
|
|
39 else
|
|
40 echo -n "already running! "
|
|
41 failure "dnsbl milter already running!"
|
|
42 echo
|
|
43 fi
|
|
44
|
|
45 ;;
|
|
46 stop)
|
|
47 # Stop daemons.
|
|
48 echo -n "Shutting down dnsbl-milter: "
|
|
49 killproc dnsbl
|
|
50 RETVAL=$?
|
|
51 echo
|
|
52 [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/dnsbl
|
|
53 ;;
|
|
54 restart|reload)
|
|
55 $0 stop
|
|
56 $0 start
|
|
57 RETVAL=$?
|
|
58 ;;
|
|
59 status)
|
|
60 status dnsbl
|
|
61 RETVAL=$?
|
|
62 ;;
|
|
63 *)
|
|
64 echo "Usage: dnsbl {start|stop|restart|status}"
|
|
65 exit 1
|
|
66 esac
|
|
67 exit $RETVAL
|