/[gentoo-x86]/mail-filter/dkim-milter/files/dkim-filter.init
Gentoo

Contents of /mail-filter/dkim-milter/files/dkim-filter.init

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Wed Oct 10 16:01:44 2007 UTC (6 years, 9 months ago) by mrness
Branch: MAIN
Changes since 1.2: +19 -73 lines
Add diffheaders support and rename approx-regex useflag in diffheaders (#195334). Add pkg_config for creating cryptographic keys needed by this package. More code cleanups.
(Portage version: 2.1.2.12)

1 #!/sbin/runscript
2 # Copyright 1999-2006 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4 # $Header: /var/cvsroot/gentoo-x86/mail-filter/dkim-milter/files/dkim-filter.init,v 1.2 2007/10/08 08:43:36 dragonheart Exp $
5
6 CONFFILE=/etc/mail/dkim-filter/${SVCNAME}.conf
7 PIDFILE=/var/run/dkim-filter/${SVCNAME}.pid
8
9 depend() {
10 use dns logger net
11 }
12
13 check_cfg() {
14
15 if [ ! -f "${CONFFILE}" ] ; then
16 eerror "Configuration file ${CONFFILE} is missing"
17 return 1
18 fi
19
20 if egrep -q '^[[:space:]]*Background[[:space:]]+no' "${CONFFILE}" ; then
21 eerror "${SVCNAME} service cannot run with Background key set to yes!"
22 return 1
23 fi
24
25 if egrep -q '^[[:space:]]*PidFile[[:space:]]' "${CONFFILE}"; then
26 eerror "Please remove PidFile key from your configuration file!"
27 eerror "${SVCNAME} is automatically configured to use ${PIDFILE} as pid file."
28 return 1
29 fi
30 }
31
32 start() {
33 check_cfg || return 1
34 local SOCKFILE=$(sed -nr -e 's/^[[:space:]]*Socket[[:space:]]+((local)|(unix))://p' "${CONFFILE}")
35
36 ebegin "Starting DKIM filter"
37 start-stop-daemon --start --pidfile "${PIDFILE}" \
38 --exec /usr/bin/dkim-filter -- -x "${CONFFILE}" -P "${PIDFILE}" && \
39 [ -z "${SOCKFILE}" ] || chmod a+rwx "${SOCKFILE}"
40 eend $?
41 }
42
43 stop() {
44 ebegin "Stopping DKIM filter"
45 start-stop-daemon --stop --pidfile "${PIDFILE}"
46 eend $?
47 }

  ViewVC Help
Powered by ViewVC 1.1.20