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

name="mautrix-telegram"
description="Daemon for Mautrix-Telegram, a Matrix-Telegram puppeting bridge"

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

command="/usr/bin/mautrix-telegram"
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-telegram
}
