neobytes/contrib/init/neobytesd.init

68 lines
1.3 KiB
Plaintext
Raw Normal View History

#!/bin/bash
#
2024-12-16 19:40: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
2024-12-16 19:40:22 +01:00
# you can override the lockfile via NEOBYTESD_LOCKFILE in /etc/sysconfig/neobytesd
lockfile=${NEOBYTESD_LOCKFILE-/var/lock/subsys/neobytesd}
2024-12-16 19:40:22 +01:00
# neobytesd defaults to /usr/bin/neobytesd, override with NEOBYTESD_BIN
neobytesd=${NEOBYTESD_BIN-/usr/bin/neobytesd}
2024-12-16 19:40:22 +01:00
# neobytesd opts default to -disablewallet, override with NEOBYTESD_OPTS
neobytesd_opts=${NEOBYTESD_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