#!/sbin/runscript # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-p2p/bitcoind/files/bitcoin.initd-r1,v 1.1 2014/02/21 14:22:42 blueness Exp $ vardir="/var/lib/bitcoin" conffile="${vardir}/.bitcoin/bitcoin.conf" bitcoind_user="${BITCOIN_USER:-nobody:nobody}" description="Bitcoin crypto-currency wallet for automated services" pidfile="/run/${SVCNAME}.pid" command="/usr/bin/bitcoind" command_args="${BITCOIN_OPTS}" command_background="true" start_stop_daemon_args="-u ${bitcoind_user} -e HOME=${vardir} -N ${NICELEVEL:-0} -w 2000" depend() { need net } start_pre() { checkpath -f -o ${bitcoind_user} -m 0400 ${conffile} || return 1 if ! grep -q '^rpcpassword=' "${conffile}"; then eerror "Please edit `readlink -f ${conffile}`" eerror "There must be at least a line assigning rpcpassword=something-secure" return 1 fi }