51 lines
1.1 KiB
Text
51 lines
1.1 KiB
Text
#!/sbin/runscript
|
|
# Copyright 1999-2014 Gentoo Foundation
|
|
# Distributed under the terms of the GNU General Public License, v2 or later
|
|
# $Header: /var/cvsroot/gentoo-x86/mail-mta/nullmailer/files/init.d-nullmailer-r4,v 1.1 2014/01/08 15:08:13 jlec Exp $
|
|
|
|
command="/usr/sbin/nullmailer-send"
|
|
|
|
start_stop_daemon_args="--chdir /var/nullmailer --user nullmail:nullmail"
|
|
|
|
required_dirs="/var/nullmailer"
|
|
pidfile="/run/nullmailer.pid"
|
|
command_background="true"
|
|
command_args="-s"
|
|
|
|
depend() {
|
|
use net logger
|
|
}
|
|
|
|
checkconfig() {
|
|
local error=0
|
|
local f=/etc/nullmailer/me
|
|
if [ ! -s ${f} ]; then
|
|
eerror "${f} does not exist"
|
|
error=1
|
|
fi
|
|
f=/etc/nullmailer/defaultdomain
|
|
if [ ! -s ${f} ]; then
|
|
eerror "${f} does not exist"
|
|
error=1
|
|
fi
|
|
if [ ${error} -eq 1 ]; then
|
|
einfo "You need to run 'emerge --config nullmailer'!"
|
|
fi
|
|
if [ -e /service/nullmailer ]; then
|
|
eerror "Nullmailer is already running under svscan!"
|
|
error=2
|
|
fi
|
|
if [ ${error} -ne 0 ]; then
|
|
return 1
|
|
else
|
|
return 0
|
|
fi
|
|
}
|
|
|
|
start_pre() {
|
|
checkconfig
|
|
}
|
|
|
|
stop_pre() {
|
|
checkconfig # to avoid init.d stopping svscan instance
|
|
}
|