mirror of
https://github.com/eliasstepanik/ark-ac-server-tools.git
synced 2026-01-13 03:18:28 +00:00
43 lines
898 B
Bash
43 lines
898 B
Bash
#!/bin/bash
|
|
|
|
NAME=arkmanager_daemon
|
|
DESC="ARK manager daemon used to start the server and keep it updated"
|
|
PIDFILE="/var/run/${NAME}.pid"
|
|
LOGFILE="/var/log/${NAME}.log"
|
|
|
|
DAEMON="sh /usr/bin/arkmanager daemon"
|
|
|
|
START_OPTS="--start --background --make-pidfile --pidfile ${PIDFILE} --exec ${DAEMON}"
|
|
STOP_OPTS="--stop --pidfile ${PIDFILE}"
|
|
|
|
test -x $DAEMON || exit 0
|
|
|
|
set -e
|
|
|
|
case "$1" in
|
|
start)
|
|
echo -n "Starting ${DESC}: "
|
|
start-stop-daemon $START_OPTS >> $LOGFILE
|
|
echo "$NAME."
|
|
;;
|
|
stop)
|
|
echo -n "Stopping $DESC: "
|
|
start-stop-daemon $STOP_OPTS
|
|
echo "$NAME."
|
|
rm -f $PIDFILE
|
|
;;
|
|
restart|force-reload)
|
|
echo -n "Restarting $DESC: "
|
|
start-stop-daemon $STOP_OPTS
|
|
sleep 1
|
|
start-stop-daemon $START_OPTS >> $LOGFILE
|
|
echo "$NAME."
|
|
;;
|
|
*)
|
|
N=/etc/init.d/$NAME
|
|
echo "Usage: $N {start|stop|restart|force-reload}" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
exit 0 |