]> git.donarmstrong.com Git - deb_pkgs/spamass-milter.git/blob - contrib/spamass-milter
[svn-inject] Installing original source of spamass-milter
[deb_pkgs/spamass-milter.git] / contrib / spamass-milter
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
29 PATH=/sbin:/bin:/usr/sbin:/usr/bin
30 DAEMON=/etc/mail/bin/spamass-milter
31 SOCKET=/var/run/sendmail/spamass.sock
32 DESC="Sendmail milter plugin for SpamAssassin"
33
34 test -x $DAEMON || exit 0
35
36 set -e
37
38 case "$1" in
39   start)
40         echo -n "Starting $DESC: "
41
42         start-stop-daemon --start -b --exec $DAEMON --oknodo -- -p $SOCKET
43
44         echo "${DAEMON}"
45         ;;
46   stop)
47         echo -n "Stopping $DESC: "
48
49         start-stop-daemon --stop --exec $DAEMON --oknodo 
50         /bin/sleep 5s
51         /bin/rm -f $SOCKET
52
53         echo "${DAEMON}"
54         ;;
55   restart)
56         echo -n "Restarting $DESC: "
57
58         start-stop-daemon --stop --exec $DAEMON --oknod
59         /bin/sleep 5s
60         /bin/rm -f $SOCKET
61         start-stop-daemon --start -b --exec $DAEMON --oknodo -- -p $SOCKET
62
63         echo "${DAEMON}"
64
65         ;;
66   *)
67         N=$0
68         echo "Usage: $N {start|stop|restart}" >&2
69         exit 1
70         ;;
71 esac
72
73 exit 0