1

I have a bash script that shuts down a headless Mac in my office without needing to sudo…

ssh [email protected] osascript <<EOF
   tell application "System Events" to shut down
EOF

The only problem is, I get this alert on the headless Mac…

enter image description here

I don't care about this error, the other 'user' is me and I assume it's just a hangover from sharing a volume from this headless computer to my main computer. Even hours after disconnecting the volume it insists on warning me anyway.

Is there a way I can either override this warning or have AppleScript click the 'Shut Down' button for me? There's no keyboard shortcut in this dialog, it can only be clicked.

BTW - Logging in over VNC and shutting down manually is not an option. I need it as an AppleScript as I'm integrating it into a larger script that I'm writing.

1
  • I've been looking for an answer to this for a long time... will be watching this question.
    – JVC
    Apr 8, 2020 at 16:32

0

You must log in to answer this question.

Browse other questions tagged .