shutdown command in background, this did the job for me:
ssh root@remote-ip "some-command > /dev/null; shutdown -r now &"
some-command > /dev/null: runs
some-command and redirects the output to
/dev/null, so I don't get any output as you said.
shutdown -r now &: runs the
shutdown command in background and leaves the shell for getting further commands.
uname is my
#do other things for test purpose, which will be executed right after remote system is going down; )does not waits for it to be complete).
There are other ways to achieve this result too, e.g you can run the whole command in background:
ssh root@remote-ip "some-command > /dev/null; shutdown -r now" &
Or run it in a sub shell:
$(ssh root@remote-ip "some-command; shutdown -r now")
Although I suggest the first one, meaning running the
shutdown command in the background of remote machine.