-
Notifications
You must be signed in to change notification settings - Fork 1
/
qmail-clam
executable file
·95 lines (91 loc) · 2.04 KB
/
qmail-clam
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
95
#!/bin/sh
#
# Copyright (C) 2007-2010 Eric Shubert <[email protected]>
# Jake Vickers <[email protected]>
#
# Script for controlling the clamd daemon
#
#############################################################################
# change log
# 04/07/14 shubes - (re)moved log process
# 01/06/10 shubes - refactored, added silent option for sane security script
# 08-02-07 Jake - adapted from the qmail-spam script I wrote a while ago.
#############################################################################
myname=${0##*/}
myver=v0.4
clamdir=/var/qmail/supervise/clamd
unset silent
if [ "$1" == "-s" ]; then
silent=$1
shift
fi
case "$1" in
start)
if [ ! $silent ]; then
echo "Starting clamd ..."
fi
if svok $clamdir ; then
svc -u $clamdir # $clamdir/log
sleep 2
else
if [ ! $silent ]; then
echo "supervise for clamd not running!"
fi
fi
;;
stop)
if [ ! $silent ]; then
echo "Stopping clamd ..."
fi
svc -d $clamdir # $clamdir/log
sleep 2
;;
pause)
if [ ! $silent ]; then
echo "Pausing clamd ..."
fi
svc -p $clamdir
sleep 2
;;
cont)
if [ ! $silent ]; then
echo "Continuing clamd ..."
fi
svc -c $clamdir
sleep 2
;;
restart)
if [ ! $silent ]; then
echo "Restarting clamd...."
fi
svc -d $clamdir # $clamdir/log
svc -t $clamdir # $clamdir/log
svc -u $clamdir # $clamdir/log
sleep 2
;;
stat | status)
:
;;
help)
cat <<HELP
stop -- stops clamd service
start -- starts clamd service
restart -- stops and restarts clamd
pause -- temporarily stops clamd service
cont -- continues paused clamd service
stat -- displays status of clamd service
status -- displays status of clamd service
HELP
exit 1
;;
*)
echo "Usage: $me [-s] {start|stop|restart|stat|status|pause|cont|help}"
exit 1
;;
esac
if [ ! $silent ]; then
echo
svstat /var/qmail/supervise/clamd
# svstat /var/qmail/supervise/clamd/log
fi
exit 0