summaryrefslogtreecommitdiff
blob: f1cb9b819a72e430a1ff01e73abc82e98fbd99f0 (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
#!/sbin/runscript

svc_name="AntiVir MailGate"

## required executables
antivir_mailgate_script="/usr/lib/AntiVir/avmailgate"

## required config files
antivir_mailgate_cfg="/etc/avmailgate.conf"
antivir_mailgate_acl="/etc/avmailgate.acl"

depend() {
	need net
	use logger dns
}

checkconfig() {
	if [ ! -x "${antivir_mailgate_script}" ]; then
		eerror "AntiVir MailGate script [${antivir_mailgate_script}] missing"
		return 1
	fi
	if [ ! -r "${antivir_mailgate_cfg}" ]; then
		eerror "AntiVir MailGate config [${antivir_mailgate_cfg}] missing"
		return 1
	fi
	if [ ! -r "${antivir_mailgate_acl}" ]; then
		eerror "AntiVir MailGate ACL [${antivir_mailgate_acl}] missing"
		return 1
	fi
}

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

stop() {
	checkconfig || return 1
	ebegin "Stopping ${svc_name}"
	"${antivir_mailgate_script}" stop
	eend $?
}