]> arthur.barton.de Git - nagcollect.git/blob - contrib/launch-osx.sh
Update README and INSTALL to describe active service checks
[nagcollect.git] / contrib / launch-osx.sh
1 #!/bin/sh
2 #
3 # NagCollect -- Nagios Data Collector for Passive Checks
4 # Copyright (c)2009,2011 Alexander Barton, alex@barton.de
5 #
6 logger -t "launch-osx.sh" -s "starting ..."
7 [ -r /usr/local/etc/nagcollect.conf ] && . /usr/local/etc/nagcollect.conf
8 if [ -n "$SERVER_URL" -a -n "$CLIENT_KEY" -a -n "$CLIENT_ID" ]; then
9         logger -t "launch-osx.sh" -s "Configuration valid, loading LaunchDaemon script ..."
10         chown root:wheel /Library/LaunchDaemons/de.barton.nagcollect.plist
11         chmod 644 /Library/LaunchDaemons/de.barton.nagcollect.plist
12         launchctl load -w /Library/LaunchDaemons/de.barton.nagcollect.plist
13 else
14         logger -t "launch-osx.sh" -s "Configuration not valid, NOT LOADING LaunchDaemon script!"
15 fi
16 logger -t "launch-osx.sh" -s "done."