summaryrefslogtreecommitdiff
path: root/finance/bitcoin/files/bitcoind.sh
blob: 708234ac97cc6c9700a462fb7a503bb65bd7e106 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!@RCD_SCRIPTS_SHELL@
#
# $NetBSD: bitcoind.sh,v 1.1 2018/07/08 11:13:46 khorben Exp $
#

# PROVIDE: bitcoind
# REQUIRE: DAEMON LOGIN wscons
# KEYWORD: shutdown

if [ -f /etc/rc.subr ]; then
	. /etc/rc.subr
fi

name="bitcoind"
rcvar=$name
command="@PREFIX@/bin/bitcoind"
pidfile="@VARBASE@/run/bitcoind.pid"
required_directory="@VARBASE@/bitcoin"
command_args="-daemon -conf=@PREFIX@/etc/bitcoin.conf -pid=${pidfile} -datadir=${required_directory}"

if [ -f /etc/rc.subr ]; then
	load_rc_config $name
	run_rc_command "$1"
else
	echo -n " ${name}"
	${command} ${bitcoin_flags} ${command_args}
fi