]>
Commit | Line | Data |
---|---|---|
291dbbd4 AM |
1 | #!/bin/sh |
2 | # | |
3 | # clamd clamd (antyvirus daemon) | |
4 | # | |
5 | # chkconfig: 345 60 40 | |
6 | # | |
7 | # description: clamd (secure shell daemon) is a server part of the ssh suite. | |
8 | # Ssh can be used for remote login, remote file copying, TCP port | |
9 | # forwarding etc. Ssh offers strong encryption and authentication. | |
10 | ||
11 | ||
12 | # Source function library | |
13 | . /etc/rc.d/init.d/functions | |
14 | ||
15 | # Get network config | |
16 | . /etc/sysconfig/network | |
17 | ||
18 | # Get service config | |
19 | [ -f /etc/sysconfig/clamd ] && . /etc/sysconfig/clamd | |
20 | ||
21 | # See how we were called. | |
22 | case "$1" in | |
23 | start) | |
24 | # Check if the service is already running? | |
25 | if [ ! -f /var/lock/subsys/clamd ]; then | |
26 | msg_starting clamd | |
27 | daemon /usr/sbin/clamd | |
28 | RETVAL=$? | |
29 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/clamd | |
30 | else | |
31 | msg_already_running clamd | |
32 | fi | |
33 | ;; | |
34 | stop) | |
35 | if [ -f /var/lock/subsys/clamd ]; then | |
36 | msg_stopping clamd | |
37 | killproc clamd | |
38 | rm -f /var/run/clamd.pid /var/lock/subsys/clamd >/dev/null 2>&1 | |
39 | else | |
40 | msg_not_running clamd | |
41 | exit 1 | |
42 | fi | |
43 | ;; | |
44 | restart) | |
45 | $0 stop | |
46 | $0 start | |
47 | ;; | |
48 | status) | |
49 | status clamd | |
50 | exit $? | |
51 | ;; | |
52 | reload) | |
53 | msg_reloading clamd | |
54 | killproc clamd -HUP | |
55 | ;; | |
56 | *) | |
57 | msg_usage "$0 {start|stop|init|status|restart|reload}" | |
58 | exit 1 | |
59 | esac | |
60 | ||
61 | exit $RETVAL |