Browse code

First draft

git-svn: trunk@358

Nigel Horne authored on 2004/03/01 10:15:23
Showing 1 changed files
1 1
new file mode 100755
... ...
@@ -0,0 +1,75 @@
0
+#!/bin/sh
1
+#
2
+# clamav-milter This script starts and stops the clamav-milter daemon
3
+#
4
+# chkconfig: 2345 91 30
5
+#
6
+# description: clamav-milter is a daemon which hooks into sendmail and routes
7
+#              email messages to clamav
8
+# processname: clamav-milter
9
+
10
+# Source function library.
11
+. /etc/rc.d/init.d/functions
12
+
13
+# Source networking configuration.
14
+. /etc/sysconfig/network
15
+
16
+# Local clamav-milter config
17
+CLAMAV_FLAGS=
18
+test -f /etc/sysconfig/clamav-milter && . /etc/sysconfig/clamav-milter
19
+
20
+# Check that networking is up.
21
+[ ${NETWORKING} = "no" ] && exit 0
22
+
23
+[ -x /usr/local/sbin/clamav-milter ] || exit 0
24
+PATH=$PATH:/usr/bin:/usr/local/sbin:/usr/local/bin
25
+
26
+RETVAL=0
27
+
28
+start() {
29
+        echo -n "Starting clamav-milter: "
30
+        daemon clamav-milter ${CLAMAV_FLAGS}
31
+        RETVAL=$?
32
+        echo
33
+	test $RETVAL -eq 0 && touch /var/lock/subsys/clamav-milter
34
+	return $RETVAL
35
+}
36
+
37
+stop() {
38
+        echo -n "Shutting down clamav-milter: "
39
+        killproc clamav-milter
40
+        RETVAL=$?
41
+        echo
42
+	test $RETVAL -eq 0 && rm -f /var/lock/subsys/clamav-milter
43
+}
44
+
45
+restart() {
46
+	stop
47
+	start
48
+}
49
+
50
+# See how we were called.
51
+case "$1" in
52
+  start)
53
+        # Start daemon.
54
+	start
55
+        ;;
56
+  stop)
57
+        # Stop daemon.
58
+	stop
59
+        ;;
60
+  restart|reload)
61
+	restart
62
+        ;;
63
+  condrestart)
64
+	test -f /var/lock/subsys/clamav-milter && $0 restart || :
65
+        ;;
66
+  status)
67
+        status clamav-milter
68
+        ;;
69
+  *)
70
+        echo "Usage: $0 {start|stop|reload|restart|condrestart|status}"
71
+        exit 1
72
+esac
73
+
74
+exit $?