To use:
- Create a 'reboot' project with the reboot script in it. You'll need to encode the root password in the script so it can run shutdown, or otherwise arrange access to 'shutdown'.
- Create a 'await reboot' project with the await script in it. Add the 'reboot' project as a snapshot dependency, that will mark the build as failed if it fails.
- Add the plist to your /Library/LaunchAgent/ directory, or add the equivalent 'sed' script into your /etc/rc.local script for proper Unixes.
- Add the 'await reboot' project as a dependency to your real build.