summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-antivirus/antivir-mailgate/files/3.0.0_p14/antivir-mailgate.initd')
-rwxr-xr-xapp-antivirus/antivir-mailgate/files/3.0.0_p14/antivir-mailgate.initd44
1 files changed, 44 insertions, 0 deletions
diff --git a/app-antivirus/antivir-mailgate/files/3.0.0_p14/antivir-mailgate.initd b/app-antivirus/antivir-mailgate/files/3.0.0_p14/antivir-mailgate.initd
new file mode 100755
index 0000000..f1cb9b8
--- /dev/null
+++ b/app-antivirus/antivir-mailgate/files/3.0.0_p14/antivir-mailgate.initd
@@ -0,0 +1,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 $?
+}