Added files for Linux and OS X
This commit is contained in:
parent
d9498b99fd
commit
23ec3ede95
3 changed files with 77 additions and 0 deletions
58
cronosagent-init
Executable file
58
cronosagent-init
Executable file
|
@ -0,0 +1,58 @@
|
|||
#!/bin/bash
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: cronosagent
|
||||
# Required-Start: $remote_fs $syslog
|
||||
# Required-Stop: $remote_fs $syslog
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Start cronosagent at boot time
|
||||
# Description: CronosAgent for BrandMeister DMR Server
|
||||
### END INIT INFO
|
||||
|
||||
NAME="CronosAgent"
|
||||
DIRECTORY="/opt/$NAME"
|
||||
|
||||
DAEMON="$DIRECTORY/cronosagent.sh"
|
||||
ARGUMENTS="6"
|
||||
|
||||
USER=cronos
|
||||
GROUP=cronos
|
||||
|
||||
[ -f $DAEMON ] || exit 0
|
||||
|
||||
start () {
|
||||
echo -n "Starting $NAME: "
|
||||
start-stop-daemon --start --exec $DAEMON --chuid $USER:$GROUP --chdir $DIRECTORY -- $ARGUMENTS
|
||||
RETVAL=$?
|
||||
echo
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
stop () {
|
||||
echo -n "Stopping $NAME: "
|
||||
start-stop-daemon --stop --retry 5 --exec $DAEMON
|
||||
RETVAL=$?
|
||||
echo
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart)
|
||||
stop
|
||||
start
|
||||
;;
|
||||
status)
|
||||
status_of_proc $DAEMON $NAME
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|status}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit 0
|
Loading…
Add table
Add a link
Reference in a new issue