Mercurial > dnsbl
annotate dnsbl.rc @ 141:6256cab02248
cleanup smtp rate limit code
author | carl |
---|---|
date | Wed, 27 Sep 2006 08:11:38 -0700 |
parents | a893afee4b80 |
children | 97d7da45fe2a |
rev | line source |
---|---|
105 | 1 # -- bash header installed by automake -- |
0 | 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 | |
41
d95af8129dfa
updates for 3.2, changing file layout, add queueid to messages
carl
parents:
16
diff
changeset
|
20 start) |
0 | 21 # Start daemons. |
22 echo -n "Starting dnsbl-milter: " | |
41
d95af8129dfa
updates for 3.2, changing file layout, add queueid to messages
carl
parents:
16
diff
changeset
|
23 if [ ! -f /var/lock/subsys/dnsbl ]; then |
113 | 24 cd SYSCONFDIR/dnsbl # conf file is here |
105 | 25 SBINDIR/dnsbl -d 10 -r /var/run/dnsbl/dnsbl.resolver.sock -p local:/var/run/dnsbl/dnsbl.sock |
41
d95af8129dfa
updates for 3.2, changing file layout, add queueid to messages
carl
parents:
16
diff
changeset
|
26 RETVAL=$? |
105 | 27 pid=`pidof -s SBINDIR/dnsbl` |
41
d95af8129dfa
updates for 3.2, changing file layout, add queueid to messages
carl
parents:
16
diff
changeset
|
28 if [ $pid ] |
d95af8129dfa
updates for 3.2, changing file layout, add queueid to messages
carl
parents:
16
diff
changeset
|
29 then |
d95af8129dfa
updates for 3.2, changing file layout, add queueid to messages
carl
parents:
16
diff
changeset
|
30 success "Starting dnsbl milter:" |
d95af8129dfa
updates for 3.2, changing file layout, add queueid to messages
carl
parents:
16
diff
changeset
|
31 touch /var/lock/subsys/dnsbl |
d95af8129dfa
updates for 3.2, changing file layout, add queueid to messages
carl
parents:
16
diff
changeset
|
32 echo |
d95af8129dfa
updates for 3.2, changing file layout, add queueid to messages
carl
parents:
16
diff
changeset
|
33 else |
d95af8129dfa
updates for 3.2, changing file layout, add queueid to messages
carl
parents:
16
diff
changeset
|
34 failure "Starting dnsbl milter:" |
d95af8129dfa
updates for 3.2, changing file layout, add queueid to messages
carl
parents:
16
diff
changeset
|
35 echo |
d95af8129dfa
updates for 3.2, changing file layout, add queueid to messages
carl
parents:
16
diff
changeset
|
36 fi |
d95af8129dfa
updates for 3.2, changing file layout, add queueid to messages
carl
parents:
16
diff
changeset
|
37 else |
d95af8129dfa
updates for 3.2, changing file layout, add queueid to messages
carl
parents:
16
diff
changeset
|
38 echo -n "already running! " |
d95af8129dfa
updates for 3.2, changing file layout, add queueid to messages
carl
parents:
16
diff
changeset
|
39 failure "dnsbl milter already running!" |
d95af8129dfa
updates for 3.2, changing file layout, add queueid to messages
carl
parents:
16
diff
changeset
|
40 echo |
d95af8129dfa
updates for 3.2, changing file layout, add queueid to messages
carl
parents:
16
diff
changeset
|
41 fi |
d95af8129dfa
updates for 3.2, changing file layout, add queueid to messages
carl
parents:
16
diff
changeset
|
42 |
0 | 43 ;; |
41
d95af8129dfa
updates for 3.2, changing file layout, add queueid to messages
carl
parents:
16
diff
changeset
|
44 stop) |
0 | 45 # Stop daemons. |
46 echo -n "Shutting down dnsbl-milter: " | |
47 killproc dnsbl | |
48 RETVAL=$? | |
49 echo | |
50 [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/dnsbl | |
51 ;; | |
41
d95af8129dfa
updates for 3.2, changing file layout, add queueid to messages
carl
parents:
16
diff
changeset
|
52 restart|reload) |
0 | 53 $0 stop |
54 $0 start | |
55 RETVAL=$? | |
56 ;; | |
41
d95af8129dfa
updates for 3.2, changing file layout, add queueid to messages
carl
parents:
16
diff
changeset
|
57 status) |
0 | 58 status dnsbl |
59 RETVAL=$? | |
60 ;; | |
41
d95af8129dfa
updates for 3.2, changing file layout, add queueid to messages
carl
parents:
16
diff
changeset
|
61 *) |
0 | 62 echo "Usage: dnsbl {start|stop|restart|status}" |
63 exit 1 | |
64 esac | |
65 exit $RETVAL | |
41
d95af8129dfa
updates for 3.2, changing file layout, add queueid to messages
carl
parents:
16
diff
changeset
|
66 |
d95af8129dfa
updates for 3.2, changing file layout, add queueid to messages
carl
parents:
16
diff
changeset
|
67 # $Id$ |