|
mac geekeryGet your geek on. |
Performing a Clean Restart or Shutdown from the TerminalThe Mac has two different ways of doing a shutdown or restart: the Mac way and the Unix way. That is to say that one can go to the Apple Menu and pick restart or shut down and the system will gently close out all the programs and nicely tell everything it’s about to restart and then go on with itself. The other way is to issue This is not to say Sometimes that’s useful, but sometimes you’re in the odd situation of wanting a clean restart or shutdown but are in the system via SSH and don’t have the GUI up. Never fear, it’s quite possible. Just issue the following command as the same user that’s logged in to the computer:
You can use the command “shut down” if you want to power off the machine cleanly. About Adam Knight |
|
||||
Doesn’t this require that “Enable access for assistive devices” be checked in the Universal Access System Preferences Pane, since that enable the ability to GUI script with Applescript and gives you access to the “system events” application?
I haven’t tested this, but I would expect it to be so.
Sean
————————————————————————————————-
Sean P. Kane
————————————————————————————————-
Congress appropriates. Microsoft lobbies. Citizens steal.
————————————————————————————————-
Sean P. Kane
————————————————————————————————-
Congress appropriates. Microsoft lobbies. Citizens steal.
this isn’t gui scripting, so it doesn’t require the Assistive option.
Cool, that’s good to know. I didn’t think you could access any “System Events” via Applescript without the Assistive option turned on.
Thanks,
Sean
————————————————————————————————-
Sean P. Kane
————————————————————————————————-
Congress appropriates. Microsoft lobbies. Citizens steal.
————————————————————————————————-
Sean P. Kane
————————————————————————————————-
Congress appropriates. Microsoft lobbies. Citizens steal.
what program do you enter that code in?
Terminal.app (use spotlight to find it)