Restart notification using Apple's dialog

May
Contributor III

I'd like to add a restart to the end of a delete keychain script that users can run from Self Service,
is there any way to trigger Apple's restart dialog so the users can choose to Cancel or Restart, i know
i could create a notification/script using Cocoa Dialog or jamfHelper but i'd like to keep it simple if possible.

I've looked for a keyboard shortcut that simulates restart from the Apple Menu as i thought i could maybe send those key strokes in a script?, and running sudo shutdown -r doesn't give any feedback at the user level.

a37759dad21b44fab1afb5cfbb6e8f87

cheers

1 ACCEPTED SOLUTION

May
Contributor III

If i'd just searched harder!

osascript -e 'tell app "loginwindow" to «event aevtrrst»'

does what i need

View solution in original post

1 REPLY 1

May
Contributor III

If i'd just searched harder!

osascript -e 'tell app "loginwindow" to «event aevtrrst»'

does what i need