Currently, I'm using GNU screen on my iPad and utilizing screen as a safety in the event the connection is lost. Currently, I just run screen -S ipad as the first command, but is there a way to have it automatically connect to the old ipad session if it exists (and create it if not)? My one caveat is that I'd like to do this in one command, and automatically.
The -D -R
options will make screen try to detach or create if necessary.
screen -D -R -S ipad
I recommend you taking a look at all the -d|D -r|-R|-RR
options in the screen manual, since there are many with similar results.
-d -r
Reattach a session and if necessary detach it first.
-d -R
Reattach a session and if necessary detach or even create it first.
-d -RR
Reattach a session and if necessary detach or create it. Use the first session if more than
one session is available.
-D -r
Reattach a session. If necessary detach and logout remotely first.
-D -R
Attach here and now. In detail this means: If a session is running, then reattach. If necessary
detach and logout remotely first. If it was not running create it and notify the user. This is
the author's favorite.
-D -RR
Attach here and now. Whatever that means, just do it.
Note: It is always a good idea to check the status of your sessions by means of "screen -list".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With