-
Notifications
You must be signed in to change notification settings - Fork 1
/
qmail-spam
executable file
·94 lines (85 loc) · 2.06 KB
/
qmail-spam
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/sh
# Copyright (C) 2006-2006 Jake Vickers
# Written by Jake Vickers ([email protected]) on 8-5-2005
#
# This script allows you to start/stop/restart/pause/cont your spamd
# daemon in QmailToaster easier. Great for when you make changes to
# your local.cf or add more rules.
#
# Lots of hints from www.newvibes.net/linux/qmail.html
# were used to write this modified script
# This of course comes with no warranty.
# It works for me, it may not work for you!
case "$1" in
start)
echo "Starting spamd...."
if svok /var/qmail/supervise/spamd ; then
svc -u /var/qmail/supervise/spamd
else
echo "supervise for spamd not running!"
fi
echo
sleep 2
svstat /var/qmail/supervise/spamd
# svstat /var/qmail/supervise/spamd/log
;;
stop)
echo "Stopping spamd...."
svc -d /var/qmail/supervise/spamd
sleep 2
echo
svstat /var/qmail/supervise/spamd
# svstat /var/qmail/supervise/spamd/log
;;
pause)
echo "Pausing spamd...."
svc -p /var/qmail/supervise/spamd
echo
sleep 2
svstat /var/qmail/supervise/spamd
;;
cont)
echo "Continuing spamd...."
svc -c /var/qmail/supervise/spamd
sleep 2
echo
svstat /var/qmail/supervise/spamd
# svstat /var/qmail/supervise/spamd/log
;;
restart)
echo "Restarting spamd...."
svc -d /var/qmail/supervise/spamd
svc -t /var/qmail/supervise/spamd
svc -u /var/qmail/supervise/spamd
sleep 2
echo
svstat /var/qmail/supervise/spamd
# svstat /var/qmail/supervise/spamd/log
;;
stat)
svstat /var/qmail/supervise/spamd
# svstat /var/qmail/supervise/spamd/log
echo
;;
status)
svstat /var/qmail/supervise/spamd
# svstat /var/qmail/supervise/spamd/log
echo
;;
help)
cat <<HELP
stop -- stops spamd service
start -- starts spamd service
pause -- temporarily stops spamd service
cont -- continues paused spamd service
stat -- displays status of spamd service
restart -- stops and restarts spamd
status -- displays status of spamd service
HELP
;;
*)
echo "Usage: $0 {start|stop|restart|stat|pause|cont|status|help}"
exit 1
;;
esac
exit 0