]> git.pld-linux.org Git - packages/exiscan.git/blame - exiscan.init
- massive attack: adding Source-md5
[packages/exiscan.git] / exiscan.init
CommitLineData
a0f186bb
AM
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.
19if is_yes "${NETWORKING}"; then
f91b6da6 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
a0f186bb 25else
f91b6da6 26 exit 0
a0f186bb
AM
27fi
28
d3b159a5 29RETVAL=0
a0f186bb
AM
30# See how we were called.
31case "$1" in
32 start)
33 # Check if the service is already running?
f91b6da6 34 if [ ! -f /var/lock/subsys/exiscan ]; then
a0f186bb 35 msg_starting exiscan
0777b633 36 if ! (/usr/bin/exim -bP | grep -q "^queue_only$"); then
f91b6da6 37 fail
38 nls "exim.conf: queue_only = true is missing"
39 RETVAL=1
a0f186bb 40 else
f91b6da6 41 daemon exiscan /etc/mail/exiscan.cf
42 RETVAL=$?
a0f186bb 43 fi
f91b6da6 44 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/exiscan
a0f186bb 45 else
f91b6da6 46 msg_already_running exiscan
a0f186bb
AM
47 fi
48 ;;
49 stop)
f91b6da6 50 # Stop daemons.
a0f186bb 51 if [ -f /var/lock/subsys/exiscan ]; then
f91b6da6 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
a0f186bb
AM
57 fi
58 ;;
59 status)
60 status exiscan
d3b159a5 61 exit $?
a0f186bb 62 ;;
d3b159a5 63 restart|force-reload)
a0f186bb
AM
64 $0 stop
65 $0 start
d3b159a5 66 exit $?
a0f186bb
AM
67 ;;
68 *)
d3b159a5 69 msg_usage "$0 {start|stop|restart|force-reload|status}"
70 exit 3
a0f186bb
AM
71esac
72
73exit $RETVAL
This page took 0.077794 seconds and 4 git commands to generate.