1 |
#!/bin/sh |
2 |
# |
3 |
# Startup script for the Clamav Milter Daemon |
4 |
# |
5 |
# chkconfig: 2345 77 23 |
6 |
# description: clamav-milter is a daemon which hooks into sendmail \ |
7 |
# and routes email messages to clamav. |
8 |
# processname: clamav-milter |
9 |
# pidfile: /var/run/clamav/clamav-milter.pid |
10 |
# config: /etc/sysconfig/clamav-milter |
11 |
|
12 |
# Source function library. |
13 |
. /etc/rc.d/init.d/functions |
14 |
|
15 |
# Source networking configuration. |
16 |
. /etc/sysconfig/network |
17 |
|
18 |
[ -x /usr/sbin/clamav-milter ] || exit 0 |
19 |
|
20 |
# Local clamav-milter config |
21 |
CLAMAV_FLAGS= |
22 |
test -f /etc/sysconfig/clamav-milter && . /etc/sysconfig/clamav-milter |
23 |
|
24 |
# See how we were called. |
25 |
case "$1" in |
26 |
start) |
27 |
echo -n "Starting Clamav Milter Daemon: " |
28 |
daemon clamav-milter $CLAMAV_FLAGS $SOCKET_ADDRESS |
29 |
RETVAL=$? |
30 |
echo |
31 |
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/clamav-milter |
32 |
;; |
33 |
stop) |
34 |
echo -n "Stopping Clamav Milter Daemon: " |
35 |
killproc clamav-milter |
36 |
RETVAL=$? |
37 |
echo |
38 |
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/clamav-milter |
39 |
;; |
40 |
status) |
41 |
status clamav-milter |
42 |
RETVAL=$? |
43 |
;; |
44 |
restart|reload) |
45 |
$0 stop |
46 |
$0 start |
47 |
RETVAL=$? |
48 |
;; |
49 |
condrestart) |
50 |
[ -e /var/lock/subsys/clamd ] && restart |
51 |
RETVAL=$? |
52 |
;; |
53 |
*) |
54 |
echo "Usage: clamav-milter {start|stop|status|restart|reload|condrestart}" |
55 |
exit 1 |
56 |
esac |
57 |
|
58 |
exit $RETVAL |