8 # Add the following lines to /etc/rc.conf.local or /etc/rc.conf
9 # to enable this service:
11 # novacoin_enable (bool): Set to NO by default. Set this variable to YES if you want to enable novacoin service.
12 # novacoin_config (path): Set to /usr/local/etc/novacoin.conf by default.
13 # novacoin_user: The user account novacoin daemon runs as. It uses 'root' user by default.
14 # novacoin_group: The group account novacoin daemon runs as. It uses 'wheel' group by default.
15 # novacoin_datadir (str): Default to "/var/db/novacoin". Base data directory.
22 : ${novacoin_enable:=NO}
23 : ${novacoin_config=/usr/local/etc/novacoin.conf}
24 : ${novacoin_datadir=/var/db/novacoin}
25 : ${novacoin_user="root"}
26 : ${novacoin_group="wheel"}
28 required_files=${novacoin_config}
29 command=/usr/local/bin/novacoind
30 novacoin_chdir=${novacoin_datadir}
31 pidfile="${novacoin_datadir}/novacoind.pid"
32 stop_cmd=novacoin_stop
33 command_args="-conf=${novacoin_config} -datadir=${novacoin_datadir} -noupnp -daemon -pid=${pidfile}"
34 start_precmd="${name}_prestart"
36 novacoin_create_datadir()
38 echo "Creating data directory"
39 eval mkdir -p ${novacoin_datadir}
40 [ $? -eq 0 ] && chown -R ${novacoin_user}:${novacoin_group} ${novacoin_datadir}
45 if [ ! -d "${novacoin_datadir}/." ]; then
46 novacoin_create_datadir || return 1
50 novacoin_requirepidfile()
52 if [ ! "0`check_pidfile ${pidfile} ${command}`" -gt 1 ]; then
53 echo "${name} not running? (check $pidfile)."
60 novacoin_requirepidfile
62 echo "Stopping ${name}."
63 eval ${command} -conf=${novacoin_config} -datadir=${novacoin_datadir} stop
64 wait_for_pids ${rc_pid}