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
Answers (1)
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 12 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 12 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 12 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 12 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 12 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 12 years ago -
This solved the issue:
shutdown -r +2 >./test 2>&1 >./test2 - thefishyfew 12 years ago -
What is the script you are running? I am trying the same thing but on Windows - JLetkiewicz@waterstruck.com 12 years ago
-
Check [Timeout (minutes)] at the bottom of your script item. It is set 10 minutes by default. - h-shimada 11 years ago