File: spampd-rh-rc-script.sh

package info (click to toggle)
spampd 2.62-2
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,072 kB
  • sloc: perl: 7,117; sh: 240; makefile: 18
file content (58 lines) | stat: -rw-r--r-- 1,196 bytes parent folder | download
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
#!/bin/sh
#
# This script starts and stops the spampd daemon
#
####   NOTE   #####
#  This is a very old and outdated example!!!
#  Recommend checking the Debian version of spampd.init script,
#  in the /debian branch of the source repository
#  (https://github.com/mpaperno/spampd/tree/debian).
#
# chkconfig: 2345 80 30
#
# description: spampd is a daemon process which uses SpamAssassin to check
#              email messages for SPAM.

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

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

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

[ -f /usr/bin/spampd -o -f /usr/local/bin/spampd ] || exit 0
PATH=$PATH:/usr/bin:/usr/local/bin

# See how we were called.
case "$1" in
  start)
	# Start daemon.
	echo -n "Starting spampd: "
	daemon spampd --port=10025 --relayhost=127.0.0.1:25 --tagall --auto-whitelist
	RETVAL=$?
	touch /var/lock/spampd
	echo
	;;
  stop)
	# Stop daemons.
	echo -n "Shutting down spampd: "
	killproc spampd
	RETVAL=$?
	rm -f /var/lock/spampd
	echo
	;;
  restart)
	$0 stop
	$0 start
	;;
  status)
	status spampd
	;;
  *)
	echo "Usage: $0 {start|stop|restart|status}"
	exit 1
esac

exit 0