I want to shut down another computer in my network when shutting down my own.
For that I have created a script that logs into that machine through
ssh and powers it off. (SSH keys are set up, so no need for password.)
#! /bin/sh ssh user@remote sudo halt
And placed it in
Then I created two symlinks pointing to this file under
If I call the script manually it works as expected, but when shutting down or rebooting my machine does not have any effect on the remote one.
The only thing I can figure out is that shutdown is too fast, and there is not time for the ssh connection, but it's only a guess.