neobytes/contrib/init/neobytesd.init

68 lines
1.3 KiB
Plaintext
Raw Normal View History

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