]> git.pld-linux.org Git - packages/exiscan.git/blob - exiscan.init
- drop obsolete and outdated manual inclusion of rpm macros
[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 -a "$1" != stop -a "$1" != status ]; then
21                 msg_network_down exiscan
22                 exit 1
23         fi
24 else
25         exit 0
26 fi
27
28 RETVAL=0
29 # See how we were called.
30 case "$1" in
31   start)
32         # Check if the service is already running?
33         if [ ! -f /var/lock/subsys/exiscan ]; then
34                 msg_starting exiscan
35                 if ! (/usr/bin/exim -bP | grep -q "^queue_only$"); then
36                         fail
37                         nls "exim.conf: queue_only = true is missing"
38                         RETVAL=1
39                 else
40                         daemon exiscan /etc/mail/exiscan.cf
41                         RETVAL=$?
42                 fi
43                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/exiscan
44         else
45                 msg_already_running exiscan
46         fi
47         ;;
48   stop)
49         # Stop daemons.
50         if [ -f /var/lock/subsys/exiscan ]; then
51                 msg_stopping exiscan
52                 killproc exiscan
53                 rm -f /var/lock/subsys/exiscan > /dev/null 2>&1
54         else
55                 msg_not_running exiscan
56         fi
57         ;;
58   status)
59         status exiscan
60         exit $?
61         ;;
62   restart|force-reload)
63         $0 stop
64         $0 start
65         exit $?
66         ;;
67   *)
68         msg_usage "$0 {start|stop|restart|force-reload|status}"
69         exit 3
70 esac
71
72 exit $RETVAL
This page took 0.117858 seconds and 3 git commands to generate.