]> git.donarmstrong.com Git - deb_pkgs/spamass-milter.git/blob - debian/spamass-milter.init
Load spamass-milter-0.3.0 into spamass-milter/trunk.
[deb_pkgs/spamass-milter.git] / debian / spamass-milter.init
1 #!/bin/sh
2 #
3 # $Id: spamass-milter,v 1.4 2002/07/24 16:19:53 dnelson Exp $
4 #
5 # Sample init script for Debian GNU/Linux
6 #
7 #  Copyright (c) 2002 Georg C. F. Greve <greve@gnu.org>,
8 #   all rights maintained by FSF Europe e.V., 
9 #   Villa Vogelsang, Antonienallee 1, 45279 Essen, Germany
10 #
11 #   This program is free software; you can redistribute it and/or modify
12 #   it under the terms of the GNU General Public License as published by
13 #   the Free Software Foundation; either version 2 of the License, or
14 #   (at your option) any later version.
15 #  
16 #   This program is distributed in the hope that it will be useful,
17 #   but WITHOUT ANY WARRANTY; without even the implied warranty of
18 #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 #   GNU General Public License for more details.
20 #  
21 #   You should have received a copy of the GNU General Public License
22 #   along with this program; if not, write to the Free Software
23 #   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
24 #
25 #   Contact:
26 #            Michael Brown <michaelb@opentext.com>
27
28 # This init script was modified on Thu, 30 Jan 2003 02:06:04 -0500 by
29 # Don Armstrong <don@donarmstrong.com> from contrib/spamass-milter to
30 # allow force-reload and options specified in
31 # /etc/default/spamass-milter necessary for inclusion in debian.
32
33
34 PATH=/sbin:/bin:/usr/sbin:/usr/bin
35 DAEMON=/usr/sbin/spamass-milter
36 SOCKET=/var/run/sendmail/spamass.sock
37 PIDFILE=/var/run/spamass.pid
38 DESC="Sendmail milter plugin for SpamAssassin"
39
40 DEFAULT=/etc/default/spamass-milter
41 OPTIONS=""
42
43 test -x $DAEMON || exit 0
44
45 if [ -r $DEFAULT ]; then
46     . $DEFAULT;
47 fi;
48
49 set -e
50
51 case "$1" in
52   start)
53         echo -n "Starting $DESC: "
54
55         start-stop-daemon --start -p $PIDFILE --exec $DAEMON -- -P $PIDFILE -f -p $SOCKET $OPTIONS
56
57         echo "${DAEMON}"
58         ;;
59   stop)
60         echo -n "Stopping $DESC: "
61
62         start-stop-daemon --stop -p $PIDFILE --signal 3 --exec $DAEMON
63         /bin/sleep 5s
64         /bin/rm -f $SOCKET
65
66         echo "${DAEMON}"
67         ;;
68   force-reload | restart)
69         echo -n "Restarting $DESC: "
70
71         start-stop-daemon --stop -p $PIDFILE --signal 3 --exec $DAEMON
72         /bin/sleep 5s
73         /bin/rm -f $SOCKET
74         start-stop-daemon --start -p $PIDFILE --exec $DAEMON -- -P $PIDFILE -f -p $SOCKET $OPTIONS
75
76         echo "${DAEMON}"
77
78         ;;
79   *)
80         N=$0
81         echo "Usage: $N {start|stop|restart}" >&2
82         exit 1
83         ;;
84 esac
85
86 exit 0