Mercurial > dnsbl
annotate dnsbl.rc @ 85:7e4a90e5f213 initial-5-0 **INVALID**
start coding on new config syntax
author | carl |
---|---|
date | Sun, 17 Jul 2005 08:56:33 -0700 |
parents | 390ed250c5d2 |
children | c1280cd3e248 |
rev | line source |
---|---|
0 | 1 #!/bin/sh |
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 |
d95af8129dfa
updates for 3.2, changing file layout, add queueid to messages
carl
parents:
16
diff
changeset
|
24 cd /etc/dnsbl # conf file is here |
60
390ed250c5d2
use local unix domain socket for resolver process communication
carl
parents:
59
diff
changeset
|
25 /usr/sbin/dnsbl -d -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=$? |
d95af8129dfa
updates for 3.2, changing file layout, add queueid to messages
carl
parents:
16
diff
changeset
|
27 pid=`pidof -s /usr/sbin/dnsbl` |
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$ |