munkireport/munkireport-php — pull request #183 by znerol (2014-11-27 17:02:39+00:00)
Title: CLI installer

The client scripts currently are intended to be installed using an installer script which is generated on the server running munkireport. While this is rather convenient, from a security perspective it is not so great to automatically run a script with root privileges which was readily generated by a web-application. YMMV.

With a few tweaks to the installer template it is possible that the client scripts are downloaded to a custom location which will make it easier to package them.

This PR adds command line arguments to the installer script which makes it possible to install the client scripts and the preferenes plist to a custom location.

This is the output generated when using the `-h` flag:

Usage: munkireport-install.sh [OPTIONS]

-b URL Base url to munki report server
Current value: http://munkireport.lan.woz.ch/
-m PATH Path to installation directory
Current value: /usr/local/munki/
-p PATH Path to preferences file (without the .plist extension)
Current value: /Library/Preferences/MunkiReport
-n Do not run preflight script after the installation
-h Display this help message

Example:
* Install munkireport client scripts into the default location and run the
preflight script.

munkireport-install.sh

* Install munkireport and preferences into a custom location ready to be
packaged.

munkireport-install.sh -b http://munki/report/ \
-m ~/Desktop/munkireport-2.2.0/usr/local/munki/ \
-p ~/Desktop/munkireport-2.2.0/Library/Preferences/MunkiReport \
-n