mirror of
https://notabug.org/Sages-of-Gensokyo/gensokyo_kappa-overlay
synced 2025-01-19 02:11:13 +01:00
34 lines
612 B
Plaintext
34 lines
612 B
Plaintext
#!/sbin/openrc-run
|
|
|
|
PN="davmail"
|
|
USER="${PN}"
|
|
PID_FILE="/var/run/${PN}.pid"
|
|
RUN_FILE="/usr/bin/${PN}"
|
|
|
|
depend() {
|
|
need net
|
|
}
|
|
|
|
checkconfig() {
|
|
if [ ! -e ${DAVMAIL_CONF} ]; then
|
|
eerror "You need to have a valid configuration file at ${DAVMAIL_CONF}"
|
|
return 1
|
|
fi
|
|
}
|
|
|
|
start() {
|
|
checkconfig || return 1
|
|
ebegin "Starting DavMail gateway"
|
|
|
|
start-stop-daemon --start --user ${USER} \
|
|
--pidfile ${PID_FILE} --make-pidfile --background \
|
|
--exec ${RUN_FILE} -- ${DAVMAIL_CONF}
|
|
eend $?
|
|
}
|
|
|
|
stop() {
|
|
ebegin "Shutting down DavMail gateway"
|
|
start-stop-daemon --stop --user ${USER} --pidfile ${PID_FILE}
|
|
eend $?
|
|
}
|