#!/bin/sh
#
# PROVIDE: atradio
# REQUIRE: LOGIN NETWORKING
# KEYWORD: shutdown
#
# atradio.fm Connect device — a headless radio player on the AT Protocol.
#
# Enable and configure in /etc/rc.conf (or /etc/rc.conf.d/atradio):
# atradio_enable="YES"
# atradio_user="youruser" # user whose atradio session/config to use (default: root)
#
# `atradio service install` sets atradio_enable via sysrc(8) and starts it.
name="atradio"
rcvar="atradio_enable"
pidfile="/var/run/.pid"
# %%ATRADIO_BIN%% is rewritten to the installed binary path at install time.
atradio_bin="%%ATRADIO_BIN%%"
# daemon(8) backgrounds the foreground `atradio --no-tui` process, writes the
# pidfile, and supervises/restarts it (-r).
command="/usr/sbin/daemon"
command_args="-P -r -f -u --no-tui"