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
|
3
cronosagent-monit
Normal file
3
cronosagent-monit
Normal file
|
@ -0,0 +1,3 @@
|
|||
check program cronosagent with path "/opt/CronosAgent/cronosagent"
|
||||
start program = "/etc/init.d/cronosagent start"
|
||||
stop program = "/etc/init.d/cronosagent stop"
|
16
cronosagent.plist
Normal file
16
cronosagent.plist
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>Label</key>
|
||||
<string>network.brandmeister.cronosagent</string>
|
||||
<key>Program</key>
|
||||
<string>/opt/CronosAgent/cronosagent.sh</string>
|
||||
<key>ProgramArguments</key>
|
||||
<array>
|
||||
<string>2</string>
|
||||
</array>
|
||||
<key>KeepAlive</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
Loading…
Add table
Reference in a new issue