#!/bin/sh # temporarily creates an apple script that displays a dialog - if used as synchronous script, this will pause fileset activation # to modify applescript payload, edit the "create apple script" section # Oct-09-2012 , christiang@filewave.com # if no one is logged in, we don't need to warn anyone loggedon=$(who | grep console | wc -l) if [ "$loggedon" -lt "1" ]; then exit 0 fi # create apple script with message from message.txt file textmessage="$(cat /tmp/message.txt | sed -e 's/\"/\\"/g')" tee>/tmp/dialog.sh < # force NetBoot and Reinstall bless --verbose --netboot --booter tftp://140.15.205.40/NetBoot/NetBootSP0/OSX-Re-Install.nbi/i386/booter --kernelcache tftp://140.15.205.40/NetBoot/NetBootSP0/OSX-Re-Install.nbi/i386/x86_64/kernelcache --options rp=nfs:140.15.205.40:/private/tftpboot/NetBoot/NetBootSP0:OSX-Re-Install.nbi/NetInstall.dmg && shutdown -r now EOS # make script executable chmod a+x /tmp/dialog.sh # bounce script off of fwGUI, ensuring it runs in the proper context osascript -e 'tell application "fwgui" to do shell script "/tmp/dialog.sh"'>/dev/null # cleanup sleep 5 rm -rf /tmp/dialog.sh