summaryrefslogtreecommitdiff
blob: 2c7d466ad357f1e8a56731c8dae6de82526ce6c1 (plain)
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
#!/sbin/runscript
## 2003 by H+BEDV Datentechnik GmbH,
## Wolfram Schlich <wschlich@antivir.de>

svc_name="AntiVir MailGate"

## required binaries
avmailgate_bin="/usr/lib/AntiVir/avmailgate.bin"

## required config files
avmailgate_cfg="/etc/avmailgate.conf"
avmailgate_acl="/etc/avmailgate.acl"

depend() {
	need net
	use logger dns
}

checkconfig() {
	if [ ! -x "${avmailgate_bin}" ]; then
		eerror "avmailgate binary [${avmailgate_bin}] missing"
		return 1
	fi
	if [ ! -r "${avmailgate_cfg}" ]; then
		eerror "avmailgate config [${avmailgate_cfg}] missing"
		return 1
	fi
	if [ ! -r "${avmailgate_acl}" ]; then
		eerror "avmailgate acl [${avmailgate_acl}] missing"
		return 1
	fi
}

start() {
	checkconfig || return 1
	ebegin "Starting ${svc_name}"
	"${avmailgate_bin}" --start
	eend $?
}

stop() {
	checkconfig || return 2
	ebegin "Stopping ${svc_name}"
	"${avmailgate_bin}" --stop
	eend $?
}