summaryrefslogtreecommitdiff
blob: 8023f1f0d3785c05d4dfda20c654db5d4461b5b8 (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
28
#!/sbin/openrc-run
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

vardir="/var/lib/ppcoin"
conffile="${vardir}/.ppcoin/ppcoin.conf"
ppcoind_user="${PPCOIN_USER:-nobody:nobody}"

description="Cryptocurrency forked from Bitcoin which aims to be energy efficiency."
pidfile="/run/${SVCNAME}.pid"
command="/usr/bin/ppcoind"
command_args="${PPCOIN_OPTS}"
command_background="true"
start_stop_daemon_args="-u ${ppcoind_user} -e HOME=${vardir} -N ${NICELEVEL:-0} -w 2000"

depend() {
	need net
}

start_pre() {
	checkpath -f -o ${ppcoind_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
}