neobytes/contrib/init/dashd.init

68 lines
1.2 KiB
Plaintext
Raw Normal View History

#!/bin/bash
#
# dashd The Dash Core server.
#
#
# chkconfig: 345 80 20
2016-03-04 08:25:16 +01:00
# description: dashd
# processname: dashd
#
# Source function library.
. /etc/init.d/functions
2016-03-04 08:25:16 +01:00
# you can override defaults in /etc/sysconfig/dashd, see below
if [ -f /etc/sysconfig/dashd ]; then
. /etc/sysconfig/dashd
fi
RETVAL=0
2016-03-04 08:25:16 +01:00
prog=dashd
# you can override the lockfile via BITCOIND_LOCKFILE in /etc/sysconfig/dashd
lockfile=${BITCOIND_LOCKFILE-/var/lock/subsys/dashd}
2016-03-04 08:25:16 +01:00
# dashd defaults to /usr/bin/dashd, override with BITCOIND_BIN
dashd=${BITCOIND_BIN-/usr/bin/dashd}
2016-03-04 08:25:16 +01:00
# dashd opts default to -disablewallet, override with BITCOIND_OPTS
dashd_opts=${BITCOIND_OPTS--disablewallet}
start() {
echo -n $"Starting $prog: "
2016-03-04 08:25:16 +01:00
daemon $DAEMONOPTS $dashd $dashd_opts
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch $lockfile
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
killproc $prog
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f $lockfile
return $RETVAL
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $prog
;;
restart)
stop
start
;;
*)
echo "Usage: service $prog {start|stop|status|restart}"
exit 1
;;
esac