2 # Distributed under the terms of the GNU General Public License, v2 or later
4 VARDIR="/var/lib/dogecoin"
5 CONFFILE="${VARDIR}/.dogecoin/dogecoin.conf"
12 if [[ "${DOGECOIN_USER}" == "" ]] ; then
13 eerror "Please edit /etc/conf.d/dogecoind"
14 eerror "A user must be specified to run dogecoind as that user."
15 eerror "Modify USER to your needs (you may also add a group after a colon)"
18 if ! `getent passwd | cut -d ':' -f 1 | grep $( echo "${DOGECOIN_USER}" | cut -d ':' -f 1 ) -sq` ; then
19 eerror "Please edit /etc/conf.d/dogecoind"
20 eerror "Specified user must exist!"
23 if `echo "${DOGECOIN_USER}" | grep ':' -sq` ; then
24 if ! `cut -d ':' -f 1 /etc/group | grep $( echo "${DOGECOIN_USER}" | cut -d ':' -f 2 ) -sq` ; then
25 eerror "Please edit /etc/conf.d/dogecoind"
26 eerror "Specified group must exist!"
30 if ! grep -q '^rpcpassword=' "${CONFFILE}"; then
31 eerror "Please edit `readlink -f ${CONFFILE}`"
32 eerror "There must be at least a line assigning rpcpassword=something-secure"
35 if ! stat -Lc '%a' "${CONFFILE}" | grep -q '^[4567]00$'; then
36 eerror "`readlink -f ${CONFFILE}` should not be readable by other users"
43 checkconfig || return 1
44 ebegin "Starting Dogecoind daemon"
55 ebegin "Stopping Dogecoin daemon"
67 --start --user "${DOGECOIN_USER}" --name dogecoind \
68 --pidfile /var/run/dogecoind.pid --make-pidfile \
69 --env HOME="${VARDIR}" --exec /usr/bin/dogecoind \
70 --nicelevel "${NICELEVEL}" \
78 start-stop-daemon --stop --user "${DOGECOIN_USER}" \
79 --name dogecoind --pidfile /var/run/dogecoind.pid \
87 --start --user "${DOGECOIN_USER}" --name dogecoind \
88 --pidfile /var/run/dogecoind.pid --make-pidfile \
89 --env HOME="${VARDIR}" --exec /usr/bin/dogecoind \
90 --chuid "${DOGECOIN_USER}" \
91 --nicelevel "${NICELEVEL}" \
100 --user "${DOGECOIN_USER}" \
102 --pidfile /var/run/dogecoind.pid