[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reestablishing ssh connections via screen

From: Phil!Gregory
Subject: Re: Reestablishing ssh connections via screen
Date: Tue, 21 Jun 2005 17:21:45 -0400
User-agent: Mutt/1.5.9i

* JCA <address@hidden> [2005-06-21 14:06 -0700]:
> How can screen be used so that, when the notebook is brought back from
> its dormant state, whatever ssh sessions it had active with the server,
> at the time the notebook was put to sleep, are automatically
> re-established?

In your shell, do:

$ while true; do ssh otherhost; done

It sounds like that's basically what you want.  As soon as an ssh command
exits, run it again to reestablish the connection.  screen doesn't really
have anything to automatically start commands once they've exited[0].  The
closes you could get with screen would be to turn on zombie control and
run your ssh commands in separate screen windows.  You would still have to
restart them manually, but it would only take a single keystroke per

[0] Though it might be nice for 'backtick <id> 0 0 <command>' to restart
    the command if it exits.

-- contrarian of the first order... /
PGP: 026A27F2  print: D200 5BDB FC4B B24A 9248  9F7A 4322 2D22 026A 27F2
--- --
If there's nothing wrong with me, there must be something wrong with the
                       -- Beverly Crusher ("Star Trek")
---- --- --

reply via email to

[Prev in Thread] Current Thread [Next in Thread]