summaryrefslogtreecommitdiff
path: root/net-p2p/hostd/files/hostd.in
diff options
context:
space:
mode:
Diffstat (limited to 'net-p2p/hostd/files/hostd.in')
-rw-r--r--net-p2p/hostd/files/hostd.in35
1 files changed, 35 insertions, 0 deletions
diff --git a/net-p2p/hostd/files/hostd.in b/net-p2p/hostd/files/hostd.in
new file mode 100644
index 000000000000..e2cf08e5a730
--- /dev/null
+++ b/net-p2p/hostd/files/hostd.in
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+# PROVIDE: hostd
+# REQUIRE: LOGIN FILESYSTEMS netwait
+# KEYWORD: SHUTDOWN
+#
+# Add these lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# hostd_enable (bool): Set to NO by default.
+# Set it to YES to enable doormand.
+# hostd_config (path): Set to %%PREFIX%%/etc/hostd.yml
+# by default.
+
+. /etc/rc.subr
+
+name=hostd
+rcvar=${name}_enable
+
+load_rc_config $name
+
+: ${hostd_enable:=NO}
+: ${hostd_executable:="%%PREFIX%%/bin/hostd"}
+: ${hostd_config:="%%PREFIX%%/etc/hostd.yml"}
+
+hostd_env="HOSTD_CONFIG_FILE=${hostd_config}"
+pidfile="/var/run/${name}.pid"
+command="/usr/sbin/daemon"
+command_args="-r -f -H \
+ -o \"/var/log/${name}.log\" \
+ -P \"${pidfile}\" \
+ -u %%USERS%% \"${hostd_executable}\""
+
+
+run_rc_command "$1"