shell: Connect to correct machine for shutdown/restart.

Ouch.

Fixes #1196.