mirror of https://github.com/Cisco-Talos/clamav
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
77 lines
1.6 KiB
77 lines
1.6 KiB
#!/bin/sh
|
|
#
|
|
# clamav-milter This script starts and stops the clamav-milter daemon
|
|
#
|
|
# chkconfig: 2345 71 40
|
|
#
|
|
# description: clamav-milter is a daemon which hooks into sendmail and routes \
|
|
# email messages for virus scanning with ClamAV
|
|
# processname: clamav-milter
|
|
# pidfile: /var/lock/subsys/clamav-milter
|
|
|
|
# Source function library.
|
|
. /etc/rc.d/init.d/functions
|
|
|
|
# Source networking configuration.
|
|
. /etc/sysconfig/network
|
|
|
|
# Local clamav-milter config
|
|
CLAMAV_FLAGS=
|
|
test -f /etc/sysconfig/clamav-milter && . /etc/sysconfig/clamav-milter
|
|
|
|
# Check that networking is up.
|
|
[ ${NETWORKING} = "no" ] && exit 0
|
|
|
|
[ -x /usr/local/sbin/clamav-milter ] || exit 0
|
|
PATH=$PATH:/usr/bin:/usr/local/sbin:/usr/local/bin
|
|
|
|
RETVAL=0
|
|
|
|
start() {
|
|
echo -n "Starting clamav-milter: "
|
|
sleep 1 ;# allow time for clamd to start
|
|
LANG= daemon clamav-milter ${CLAMAV_FLAGS}
|
|
RETVAL=$?
|
|
echo
|
|
test $RETVAL -eq 0 && touch /var/lock/subsys/clamav-milter
|
|
return $RETVAL
|
|
}
|
|
|
|
stop() {
|
|
echo -n "Shutting down clamav-milter: "
|
|
killproc clamav-milter
|
|
RETVAL=$?
|
|
echo
|
|
test $RETVAL -eq 0 && rm -f /var/lock/subsys/clamav-milter
|
|
}
|
|
|
|
restart() {
|
|
stop
|
|
start
|
|
}
|
|
|
|
# See how we were called.
|
|
case "$1" in
|
|
start)
|
|
# Start daemon.
|
|
start
|
|
;;
|
|
stop)
|
|
# Stop daemon.
|
|
stop
|
|
;;
|
|
restart|reload)
|
|
restart
|
|
;;
|
|
condrestart)
|
|
test -f /var/lock/subsys/clamav-milter && $0 restart || :
|
|
;;
|
|
status)
|
|
status clamav-milter
|
|
;;
|
|
*)
|
|
echo "Usage: $0 {start|stop|reload|restart|condrestart|status}"
|
|
exit 1
|
|
esac
|
|
|
|
exit $?
|
|
|