aboutsummaryrefslogtreecommitdiff
path: root/multimedia/navidrome/files/navidrome.in
diff options
context:
space:
mode:
Diffstat (limited to 'multimedia/navidrome/files/navidrome.in')
-rw-r--r--multimedia/navidrome/files/navidrome.in51
1 files changed, 51 insertions, 0 deletions
diff --git a/multimedia/navidrome/files/navidrome.in b/multimedia/navidrome/files/navidrome.in
new file mode 100644
index 000000000000..afa980975d3c
--- /dev/null
+++ b/multimedia/navidrome/files/navidrome.in
@@ -0,0 +1,51 @@
+#!/bin/sh
+#
+# PROVIDE: %%PORTNAME%%
+# REQUIRE: NETWORKING
+# KEYWORD:
+#
+# Add the following lines to /etc/rc.conf to enable %%PORTNAME%%:
+# %%PORTNAME%%_enable="YES"
+#
+# %%PORTNAME%%_enable (bool): Set to YES to enable %%PORTNAME%%
+# Default: NO
+# %%PORTNAME%%_config (str): %%PORTNAME%% configration file
+# Default: %%ETCDIR%%/config.toml
+# %%PORTNAME%%_datafolder (str): %%PORTNAME%% Folder to store application data
+# Default: %%NAVIDROMEUSER%%
+# %%PORTNAME%%_user (str): %%PORTNAME%% daemon user
+# Default: %%NAVIDROMEUSER%%
+# %%PORTNAME%%_group (str): %%PORTNAME%% daemon group
+# Default: %%NAVIDROMEUSER%%
+
+. /etc/rc.subr
+
+name="%%PORTNAME%%"
+rcvar="%%PORTNAME%%_enable"
+load_rc_config $name
+
+: ${%%PORTNAME%%_user:="%%NAVIDROMEUSER%%"}
+: ${%%PORTNAME%%_group:="%%NAVIDROMEGROUP%%"}
+: ${%%PORTNAME%%_enable:="NO"}
+: ${%%PORTNAME%%_config:="%%ETCDIR%%/config.toml"}
+: ${%%PORTNAME%%_flags=""}
+: ${%%PORTNAME%%_facility:="daemon"}
+: ${%%PORTNAME%%_priority:="debug"}
+: ${%%PORTNAME%%_datafolder:="/var/db/${name}"}
+
+required_dirs=${%%PORTNAME%%_datafolder}
+required_files=${%%PORTNAME%%_config}
+procname="%%PREFIX%%/bin/${name}"
+pidfile="/var/run/${name}.pid"
+start_precmd="${name}_precmd"
+command=/usr/sbin/daemon
+command_args="-S -l ${%%PORTNAME%%_facility} -s ${%%PORTNAME%%_priority} -T ${name} -t ${name} -p ${pidfile} \
+ ${procname} --configfile ${%%PORTNAME%%_config} --datafolder ${%%PORTNAME%%_datafolder} ${%%PORTNAME%%_flags}"
+
+%%PORTNAME%%_precmd()
+{
+ install -o ${%%PORTNAME%%_user} /dev/null ${pidfile}
+}
+
+run_rc_command "$1"
+