I'm running an online shell script to upgrade Mac users to Symantec 12.1.1. Everything runs fine except for this error message at the end: "The last step timed out after no response from the client. Please try again." and the next line "Error -1 received while executing script".


I thought the error was caused by a dialog box at the end that if the user doesn't click ok, it just disappears after 20 seconds and continues on with the rest of the script. However, the error appears even if the user clicks the OK button and gives some sort of input. Any ideas what I'm missing?


Here's the part that's erroring out:

    osascript -e 'tell app "Finder" to activate'
    osascript -e 'tell app "Finder" to display dialog "Your computer will reboot in 2 minutes to complete the Symantec install. Please save all documents immediately." buttons {"OK"} default button 1 with title "TEXT GOES HERE" with icon stop giving up after 30'

    shutdown -r +2

0 Comments   [ - ] Hide Comments


Please log in to comment

Community Chosen Answer



I'm not a Mac guy, but don't you need "sudo" in front of shutdown?

Answered 09/18/2012 by: dugullett
Red Belt

  • Yes, you do have to use sudo. It would be my guess why it's failing as well.
    • You shouldn't have to use sudo as KBOX runs as a system user sort of like root or wheel. I added it anyway to confirm and there were no changes in the error message. I wonder if the Mac needs to send some sort of "I'm rebooting now" message to KBOX to end the script?
  • After further testing it has to be the shutdown command. No errors if I take it out. Errors back if I leave it in.
    • Can you try changing the Run As: option? Select a different user.

      I upgraded my Mac to 10.8 so I can't really help test.
      • I'd love to try that but it wouldn't work out in the field right now. Our Macs are not on AD and not managed (yet, KBOX is still in testing phase for macs) so the account names vary from machine to machine. This is something we are going to rectify in the future.
  • I tried changing up the command a little and still get same error:

    osascript -e 'tell application "System Events" to shut down'
  • This solved the issue:
    shutdown -r +2 >./test 2>&1 >./test2
  • What is the script you are running? I am trying the same thing but on Windows
  • Check [Timeout (minutes)] at the bottom of your script item. It is set 10 minutes by default.
Please log in to comment
Answer this question or Comment on this question for clarity


This content is currently hidden from public view.
Reason: Removed by user request
For more information, visit our FAQ's.

This content is currently hidden from public view.
Reason: Removed by user request
For more information, visit our FAQ's.

Admin Script Editor
Admin Script Editor is an integrated scripting environment available free here at ITNinja