neobytes/contrib/init/neobytesd.init
2024-12-16 19:40: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 NEOBYTESD_LOCKFILE in /etc/sysconfig/neobytesd
lockfile=${NEOBYTESD_LOCKFILE-/var/lock/subsys/neobytesd}
# neobytesd defaults to /usr/bin/neobytesd, override with NEOBYTESD_BIN
neobytesd=${NEOBYTESD_BIN-/usr/bin/neobytesd}
# neobytesd opts default to -disablewallet, override with NEOBYTESD_OPTS
neobytesd_opts=${NEOBYTESD_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