File: amavisd_init.sh

package info (click to toggle)
amavisd-new 1:2.11.0-6.1
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 12,432 kB
  • sloc: perl: 33,770; sh: 523; sql: 158; makefile: 8
file content (68 lines) | stat: -rw-r--r-- 1,400 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/sh
#
# amavisd	This script controls the amavisd-new daemon.
#		(to be used with version amavisd-new-20020630 or later)
#

# chkconfig: 2345 79 31
# description: amavisd is an interface between MTA and content checkers
# processname: amavisd
# pidfile: /var/amavis/amavisd.pid

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

#prog="/opt/amavisd-new/sbin/amavisd"
prog="/usr/sbin/amavisd"
prog_base="$(basename ${prog})"

prog_config_file="/etc/amavisd.conf"

# Source configuration.
[ -e /etc/sysconfig/${prog_base} ] && . /etc/sysconfig/${prog_base}

## Check that networking is up.
#[ ${NETWORKING} = "no" ] && exit 0

RETVAL=0

# See how we were called.
case "$1" in
  start)
	action $"Starting ${prog_base}:" ${prog} -c ${prog_config_file}
	RETVAL=$?
	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/${prog_base}
	echo
	;;
  stop)
	action $"Shutting down ${prog_base}:" ${prog} -c ${prog_config_file} stop
	RETVAL=$?
	if [ $RETVAL -eq 0 ] ; then
	        echo "${prog_base} stopped"
        	rm -f /var/lock/subsys/${prog_base}
	else
		echo
	fi
	;;
  status)
	status ${prog_base}
	RETVAL=$?
	;;
  restart)
	$0 stop
	$0 start
	RETVAL=$?
	;;
  reload)
	action $"Reloading ${prog_base}:" ${prog} -c ${prog_config_file} reload
	RETVAL=$?
	;;
  *)
	echo "Usage: $0 {start|stop|status|restart|reload}"
	exit 1
esac

exit $RETVAL