#!/usr/bin/env bash # # moneyrocketd The moneyrocket core server. # # # chkconfig: 345 80 20 # description: moneyrocketd # processname: moneyrocketd # # Source function library. . /etc/init.d/functions # you can override defaults in /etc/sysconfig/moneyrocketd, see below if [ -f /etc/sysconfig/moneyrocketd ]; then . /etc/sysconfig/moneyrocketd fi RETVAL=0 prog=moneyrocketd # you can override the lockfile via MONEYROCKETD_LOCKFILE in /etc/sysconfig/moneyrocketd lockfile=${MONEYROCKETD_LOCKFILE-/var/lock/subsys/moneyrocketd} # moneyrocketd defaults to /usr/bin/moneyrocketd, override with MONEYROCKETD_BIN moneyrocketd=${MONEYROCKETD_BIN-/usr/bin/moneyrocketd} # moneyrocketd opts default to -disablewallet, override with MONEYROCKETD_OPTS moneyrocketd_opts=${MONEYROCKETD_OPTS--disablewallet} start() { echo -n $"Starting $prog: " daemon $DAEMONOPTS $moneyrocketd $moneyrocketd_opts RETVAL=$? echo [ $RETVAL -eq 0 ] && touch $lockfile return $RETVAL } stop() { echo -n $"Stopping $prog: " killproc $prog -t600 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