2015-03-03 17:06:41 +01:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
2016-03-04 08:25:16 +01:00
|
|
|
# dashd The dash core server.
|
2015-03-03 17:06:41 +01:00
|
|
|
#
|
|
|
|
#
|
|
|
|
# chkconfig: 345 80 20
|
2016-03-04 08:25:16 +01:00
|
|
|
# description: dashd
|
|
|
|
# processname: dashd
|
2015-03-03 17:06:41 +01:00
|
|
|
#
|
|
|
|
|
|
|
|
# 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
|
2015-03-03 17:06:41 +01:00
|
|
|
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}
|
2015-03-03 17:06:41 +01:00
|
|
|
|
2016-03-04 08:25:16 +01:00
|
|
|
# dashd defaults to /usr/bin/dashd, override with BITCOIND_BIN
|
|
|
|
dashd=${BITCOIND_BIN-/usr/bin/dashd}
|
2015-03-03 17:06:41 +01:00
|
|
|
|
2016-03-04 08:25:16 +01:00
|
|
|
# dashd opts default to -disablewallet, override with BITCOIND_OPTS
|
|
|
|
dashd_opts=${BITCOIND_OPTS--disablewallet}
|
2015-03-03 17:06:41 +01:00
|
|
|
|
|
|
|
start() {
|
|
|
|
echo -n $"Starting $prog: "
|
2016-03-04 08:25:16 +01:00
|
|
|
daemon $DAEMONOPTS $dashd $dashd_opts
|
2015-03-03 17:06:41 +01:00
|
|
|
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
|