#!/sbin/openrc-run

description="Epoxy Daemon"
command="/bin/epoxy-server"
command_args="/etc/epoxyconf.toml"
command_background="yes"
pidfile="/var/run/twisp.pid"
start_stop_daemon_args="--background --make-pidfile"
output_log="/dev/ttyS0"
error_log="/dev/ttyS0"

depend() {
    need localmount
    after bootmisc
}

start() {
    ebegin "Starting ${description}"
    start-stop-daemon --start --pidfile "${pidfile}" --background --exec ${command} -- ${command_args}
    eend $?
}

stop() {
    ebegin "Stopping ${description}"
    start-stop-daemon --stop --pidfile "${pidfile}"
    eend $?
}
