67 lines
1.3 KiB
Shell
67 lines
1.3 KiB
Shell
#!/usr/bin/env bash
|
|
#
|
|
# vextad The vexta core server.
|
|
#
|
|
#
|
|
# chkconfig: 345 80 20
|
|
# description: vextad
|
|
# processname: vextad
|
|
#
|
|
|
|
# Source function library.
|
|
. /etc/init.d/functions
|
|
|
|
# you can override defaults in /etc/sysconfig/vextad, see below
|
|
if [ -f /etc/sysconfig/vextad ]; then
|
|
. /etc/sysconfig/vextad
|
|
fi
|
|
|
|
RETVAL=0
|
|
|
|
prog=vextad
|
|
# you can override the lockfile via VEXTAD_LOCKFILE in /etc/sysconfig/vextad
|
|
lockfile=${VEXTAD_LOCKFILE-/var/lock/subsys/vextad}
|
|
|
|
# vextad defaults to /usr/bin/vextad, override with VEXTAD_BIN
|
|
vextad=${VEXTAD_BIN-/usr/bin/vextad}
|
|
|
|
# vextad opts default to -disablewallet, override with VEXTAD_OPTS
|
|
vextad_opts=${VEXTAD_OPTS--disablewallet}
|
|
|
|
start() {
|
|
echo -n $"Starting $prog: "
|
|
daemon $DAEMONOPTS $vextad $vextad_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
|