I have a policy that updates an application. The package provided by the developer will launch the application into the menubar under OS versions 10.10-10.12 but not for 10.9. I've attempted to write a script that would launch it under 10.9 with my own post install script. That failed miserably though so I was going for a simple prompt for the user to restart. I'm in the class of scripting of knowing enough to be dangerous but below is what I currently have. Some insight on what I'm doing wrong would be appreciated. If someone wants to assist with the preferable method of launching the software, that would be great. The launch service needing to be launched is the following...
/Library/LaunchAgents/com.alertus.AlertusDesktopClient.plist
#! /bin/sh
Major_OS_Version=$(sw_vers -productVersion | awk -F '.' '{print $1 "." $2}')
sudo /usr/local/jamf/bin/jamf recon
if [ $Major_OS_Version == "10.9" ]
then
osascript <<EOT
tell application "Finder"
activate
display dialog "Update is complete. Your computer needs restarted for the process to be completed." buttons {"No Restart", "Restart"} default button "Restart" with icon caution
if button returned of result is "Restart" then
restart
end if
end tell
EOT`
fi
exit