blob: 76a2fbb9cd2369444eeca32b2bd2f8e35e8e4f70 (
plain) (
blame)
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
|
--- ../MailScanner-4.22-5.old/bin/mailscanner.sh Thu Jan 1 01:00:00 1970
+++ bin/mailscanner.sh Mon Aug 11 12:36:06 2003
@@ -0,0 +1,55 @@
+#!/bin/sh
+
+msbindir=/usr/local/libexec/MailScanner
+process=MailScanner
+config=/usr/local/etc/MailScanner/MailScanner.conf
+PIDFILE=/var/run/MailScanner.pid
+
+start_ms()
+{
+ pid=`ps -axww |
+ grep '[ ]'$msbindir/$process |
+ awk '{print $1}'`
+
+ if [ "x$pid" = "x" ]; then
+ # Quietly try to raise the open_files limit
+ ulimit -n 2000 >/dev/null 2>&1
+ # Restart it
+ PATH=${msbindir}:$PATH
+ echo Starting MailScanner...
+ cd $msbindir
+ $process $config
+ else
+ echo MailScanner running with pid $pid
+ fi
+}
+
+stop_ms()
+{
+ echo Stopping MailScanner...
+ kill -TERM -- -`cat $PIDFILE` 2>/dev/null
+ sleep 5
+}
+
+_action=${1:-start}
+
+case ${_action} in
+start)
+ start_ms
+ ;;
+
+stop)
+ stop_ms
+ ;;
+
+restart)
+ stop_ms
+ start_ms
+ ;;
+
+*)
+ echo "Usage: `basename $0` {start|stop|restart}" >&2
+ exit 64
+ ;;
+esac
+exit 0
|