File: slackware-rc-script.sh

package info (click to toggle)
spamassassin 4.0.2-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 25,724 kB
  • sloc: perl: 89,143; ansic: 5,193; sh: 3,737; javascript: 339; sql: 295; makefile: 209; python: 49
file content (56 lines) | stat: -rwxr-xr-x 922 bytes parent folder | download | duplicates (16)
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
#!/bin/sh

# Spamd init script for Slackware 10.0
# August, 2th 2003
# Martin Ostlund, nomicon


PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
DAEMON=/usr/bin/spamd
NAME=spamd
SNAME=rc.spamassassin
DESC="SpamAssassin Mail Filter Daemon"
PIDFILE="/var/run/$NAME.pid"
PNAME="spamd"
DOPTIONS="-d --pidfile=$PIDFILE"

KILL="/bin/kill"
KILLALL="/bin/killall"
# Defaults - don't touch, edit /etc/spamassassin.conf
ENABLED=0
OPTIONS=""

test -f /etc/spamassassin.conf && . /etc/spamassassin.conf

test "$ENABLED" != "0" || exit 0

test -f $DAEMON || exit 0

set -e

case "$1" in
  start)
	echo -n "Starting $DESC: "
	$PNAME $OPTIONS $DOPTIONS 

	echo "$NAME."
	;;
  stop)
	echo -n "Stopping $DESC: "
        $KILL `cat $PIDFILE`
	/bin/rm -f $PIDFILE
	echo "$NAME."
	;;
  restart|force-reload)
	$0 stop
	$0 start
	;;
  *)
	ME=/etc/rc.d/$SNAME
	echo "Usage: $ME {start|stop|restart|force-reload}" >&2
	exit 1
	;;
esac

exit 0