#!/sbin/openrc-run
supervisor=supervise-daemon

name="mautrix-slack"
description="Daemon for Mautrix-Slack, a Matrix-Slack puppeting bridge"

: ${config:="/etc/mautrix-slack/config.yaml"}
: ${command_user:="mautrix-slack:mautrix-slack"}

command="/usr/bin/mautrix-slack"
command_args="-c $config $command_args"

depend() {
	need net
}

start_pre() {
	checkpath --file --owner "$command_user" "$config"
	checkpath --directory --owner "$command_user" /var/log/mautrix-slack
}
