neobytes/contrib/init/neobytesd.init
2024-02-05 23:00:22 +01:00

68 lines
1.3 KiB
Bash

#!/bin/bash
#
# neobytesd The NeoBytes Core server.
#
#
# chkconfig: 345 80 20
# description: neobytesd
# processname: neobytesd
#
# Source function library.
. /etc/init.d/functions
# you can override defaults in /etc/sysconfig/neobytesd, see below
if [ -f /etc/sysconfig/neobytesd ]; then
. /etc/sysconfig/neobytesd
fi
RETVAL=0
prog=neobytesd
# you can override the lockfile via BITCOIND_LOCKFILE in /etc/sysconfig/neobytesd
lockfile=${BITCOIND_LOCKFILE-/var/lock/subsys/neobytesd}
# neobytesd defaults to /usr/bin/neobytesd, override with BITCOIND_BIN
neobytesd=${BITCOIND_BIN-/usr/bin/neobytesd}
# neobytesd opts default to -disablewallet, override with BITCOIND_OPTS
neobytesd_opts=${BITCOIND_OPTS--disablewallet}
start() {
echo -n $"Starting $prog: "
daemon $DAEMONOPTS $neobytesd $neobytesd_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