Wondering if anyone else has looked to use Yo to do their own version of Patch Management notifications to alert users an app needs quit in order to update.
The upper management at our University isn't a fan of the time warning and then force quit (without a second warning) that is offered in Jamf's Patch Management so I'm trying to use Yo to notify the user the app needs to quit.
I can get Yo to quit the app based on the action button or allow them to defer, but not sure how to have Yo also trigger the installation if they choose to quit. To get Yo to notify the current user, the script needs to run as the logged in user (who doesn't have sudo). This works for the notification and to quit the app, but sudo is then needed to use sudo jamf policy -event installCustomTrigger
. I haven't played with customizing the actual app with Xcode, I only deployed the Yo pkg to a test machine and am calling on it with yo_scheduler.
When yo_scheduler is called, it doesn't wait for your response in the script. It moves on, therefor not allowing the script to react to the user's choice. Using jamfhelper is obviously an option to address this is an easy script but the clean look of a Notification Center Alert is really enticing.
Anyone have any ideas or ways they have accomplished something like this? Hopefully I'm missing an obvious way to make it work.
#!/bin/sh
currentUser=`ls -la /dev/console | cut -d " " -f 4`
sudo -u $currentUser yo_scheduler -t "Adobe Acrobat Reader DC" -s "Please quit Acrobat Reader" -n "so it can be updated." -b "Quit App" -o "Later" --bash-action "killall AdobeReader"
Once figured out, the plan would be to use script parameters to make it more universal for all apps to use this process.