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

name="mautrix-telegram"
description="Daemon for mautrix-telegram, the Matrix-Telegram hybrid puppeting/relaybot bridge"

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

command="/usr/bin/python3"
command_args="-m mautrix_telegram -c $config $command_args"

depends() {
	need net
}

start_pre() {
	checkpath --file --owner "$command_user" /etc/mautrix-telegram/config.yaml
	checkpath --directory --owner "$command_user" /var/log/mautrix-telegram
}
