]> git.pld-linux.org Git - packages/exiscan.git/blob - exiscan.init
- massive attack: adding Source-md5
[packages/exiscan.git] / exiscan.init
1 #!/bin/sh
2 #
3 # exiscan       Antyvirus scanner
4 #
5 # chkconfig:    345 85 15
6 # description:  Middle man between exim and real virus scanner
7 #
8
9 # Source function library
10 . /etc/rc.d/init.d/functions
11
12 # Get network config
13 . /etc/sysconfig/network
14
15 # Get service config
16 [ -f /etc/sysconfig/exiscan ] && . /etc/sysconfig/exiscan
17
18 # Check that networking is up.
19 if is_yes "${NETWORKING}"; then
20         if [ ! -f /var/lock/subsys/network ]; then
21                 # nls "ERROR: Networking is down. %s can't be run." exiscan
22                 msg_network_down exiscan
23                 exit 1
24         fi
25 else
26         exit 0
27 fi
28
29 RETVAL=0
30 # See how we were called.
31 case "$1" in
32   start)
33         # Check if the service is already running?
34         if [ ! -f /var/lock/subsys/exiscan ]; then
35                 msg_starting exiscan
36                 if ! (/usr/bin/exim -bP | grep -q "^queue_only$"); then
37                         fail
38                         nls "exim.conf: queue_only = true is missing"
39                         RETVAL=1
40                 else
41                         daemon exiscan /etc/mail/exiscan.cf
42                         RETVAL=$?
43                 fi
44                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/exiscan
45         else
46                 msg_already_running exiscan
47         fi
48         ;;
49   stop)
50         # Stop daemons.
51         if [ -f /var/lock/subsys/exiscan ]; then
52                 msg_stopping exiscan
53                 killproc exiscan
54                 rm -f /var/lock/subsys/exiscan > /dev/null 2>&1
55         else
56                 msg_not_running exiscan
57         fi
58         ;;
59   status)
60         status exiscan
61         exit $?
62         ;;
63   restart|force-reload)
64         $0 stop
65         $0 start
66         exit $?
67         ;;
68   *)
69         msg_usage "$0 {start|stop|restart|force-reload|status}"
70         exit 3
71 esac
72
73 exit $RETVAL
This page took 0.654207 seconds and 3 git commands to generate.