Skip to content

Instantly share code, notes, and snippets.

@ryancdotorg
Created April 11, 2012 18:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryancdotorg/2361346 to your computer and use it in GitHub Desktop.
Save ryancdotorg/2361346 to your computer and use it in GitHub Desktop.
screen autostart
# Add to the bottom of ~/.profile
# Check if this is being called from an interactive shell
case "$-" in
*i*)
# Great, it's an interactive shell. Is this shell being stated by sshd?
if [ `readlink /proc/$PPID/exe` = "/usr/sbin/sshd" ]
then
# exec screen. Attach to or create a new session called auto_ssh.
# -x allows multiple copies of screen to be attached to the same session.
exec screen -xR auto_ssh
fi
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment