2012-05-03 13 views
11

Actualmente, estoy usando la pantalla GNU en mi iPad y utilizando la pantalla como seguridad en caso de que se pierda la conexión. Actualmente, solo ejecuto la pantalla -S ipad como el primer comando, pero ¿hay alguna manera de que se conecte automáticamente a la vieja sesión ipad si existe (y créela si no es así)? Mi única advertencia es que me gustaría hacer esto en un solo comando, y de forma automática.Pantalla GNU connect if exists, create if not

Respuesta

20

Las opciones -D -R harán que la pantalla intente despegar o crear si es necesario.

screen -D -R -S ipad 

te recomiendo echar un vistazo a todas las opciones -d|D -r|-R|-RR en el manual de la pantalla, ya que hay muchos con resultados similares.

-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". 
+0

¡Perfecto! esto era exactamente lo que estaba buscando. – bswinnerton