2015-03-03 17:06:41 +01:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
2024-12-16 19:40:22 +01:00
|
|
|
# neobytesd The Neobytes Core server.
|
2015-03-03 17:06:41 +01:00
|
|
|
#
|
|
|
|
#
|
|
|
|
# chkconfig: 345 80 20
|
2024-02-05 23:00:22 +01:00
|
|
|
# description: neobytesd
|
|
|
|
# processname: neobytesd
|
2015-03-03 17:06:41 +01:00
|
|
|
#
|
|
|
|
|
|
|
|
# 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
|
2015-03-03 17:06:41 +01:00
|
|
|
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}
|
2015-03-03 17:06:41 +01:00
|
|
|
|
2024-12-16 19:40:22 +01:00
|
|
|
# neobytesd defaults to /usr/bin/neobytesd, override with NEOBYTESD_BIN
|
|
|
|
neobytesd=${NEOBYTESD_BIN-/usr/bin/neobytesd}
|
2015-03-03 17:06:41 +01:00
|
|
|
|
2024-12-16 19:40:22 +01:00
|
|
|
# neobytesd opts default to -disablewallet, override with NEOBYTESD_OPTS
|
|
|
|
neobytesd_opts=${NEOBYTESD_OPTS--disablewallet}
|
2015-03-03 17:06:41 +01:00
|
|
|
|
|
|
|
start() {
|
|
|
|
echo -n $"Starting $prog: "
|
2024-02-05 23:00:22 +01:00
|
|
|
daemon $DAEMONOPTS $neobytesd $neobytesd_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
|