I wrote the following shell script to sleep my computer from the command line:
/usr/bin/sleepy:
#!/usr/bin/osascript
tell application "system events" to sleep
It works perfectly when run from Terminal or over a ssh connection while the computer is running normally, but while the display is asleep and the command is run over ssh, it does nothing, even though all other commands work fine. Since the point was to be able to sleep the computer remotely, that's a bit of a serious flaw.
Any suggestions?
/usr/bin/sleepy:
#!/usr/bin/osascript
tell application "system events" to sleep
It works perfectly when run from Terminal or over a ssh connection while the computer is running normally, but while the display is asleep and the command is run over ssh, it does nothing, even though all other commands work fine. Since the point was to be able to sleep the computer remotely, that's a bit of a serious flaw.
Any suggestions?