/build/static/layout/Breadcrumb_cap_w.png

Error -1 received while executing script

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
        exit


0 Comments   [ + ] Show comments

Answers (1)

Posted by: dugullett 11 years ago
Red Belt
3

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


Comments:
  • Yes, you do have to use sudo. It would be my guess why it's failing as well. - jknox 11 years ago
    • 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? - thefishyfew 11 years ago
  • After further testing it has to be the shutdown command. No errors if I take it out. Errors back if I leave it in. - thefishyfew 11 years ago
    • 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. - dugullett 11 years ago
      • 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. - thefishyfew 11 years ago
  • I tried changing up the command a little and still get same error:

    osascript -e 'tell application "System Events" to shut down' - thefishyfew 11 years ago
  • This solved the issue:
    shutdown -r +2 >./test 2>&1 >./test2 - thefishyfew 11 years ago
  • What is the script you are running? I am trying the same thing but on Windows - JLetkiewicz@waterstruck.com 11 years ago
  • Check [Timeout (minutes)] at the bottom of your script item. It is set 10 minutes by default. - h-shimada 11 years ago
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ