#!/sbin/openrc-run

name="gotify"
description="gotify notification server"

command_user="gotify:gotify"

command="/usr/bin/gotify-server"
command_args="$command_args"
command_background="yes"
pidfile="/run/$RC_SVCNAME.pid"
error_log="/var/log/gotify.log"

start_pre() {
	checkpath -f --owner "$command_user" --mode 0640 \
		/etc/gotify/config.yml
	checkpath -f --owner "$command_user" --mode 0644 \
		/var/log/gotify.log
	checkpath -d --owner "$command_user" --mode 0755 \
		/var/lib/gotify/
}

depend() {
	need net
	after firewall
}
