aboutsummaryrefslogtreecommitdiff
path: root/net-p2p/walletd/files/walletd.in
diff options
context:
space:
mode:
Diffstat (limited to 'net-p2p/walletd/files/walletd.in')
-rw-r--r--net-p2p/walletd/files/walletd.in36
1 files changed, 36 insertions, 0 deletions
diff --git a/net-p2p/walletd/files/walletd.in b/net-p2p/walletd/files/walletd.in
new file mode 100644
index 000000000000..03660950a4b3
--- /dev/null
+++ b/net-p2p/walletd/files/walletd.in
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+# PROVIDE: walletd
+# REQUIRE: LOGIN FILESYSTEMS netwait
+# KEYWORD: SHUTDOWN
+#
+# Add these lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# walletd_enable (bool): Set to NO by default.
+# Set it to YES to enable doormand.
+# walletd_datadir (path): Set to /var/lib/walletd by default.
+#
+# walletd_passwordfile (filepath): set the UI password there.
+# by default located in %%PREFIX%%/etc/walletd.conf
+
+. /etc/rc.subr
+
+name=walletd
+rcvar=${name}_enable
+
+load_rc_config $name
+
+: ${walletd_enable:=NO}
+: ${walletd_executable:="%%PREFIX%%/bin/walletd"}
+: ${walletd_config:="%%PREFIX%%/etc/walletd.yml"}
+
+walletd_env="WALLETD_CONFIG_FILE=${walletd_config}"
+pidfile="/var/run/${name}.pid"
+command="/usr/sbin/daemon"
+command_args="-r -f -H \
+ -o \"/var/log/${name}.log\" \
+ -P \"${pidfile}\" \
+ -u %%USERS%% \"${walletd_executable}\"
+
+run_rc_command "$1"