Created
April 11, 2012 18:50
-
-
Save ryancdotorg/2361346 to your computer and use it in GitHub Desktop.
screen autostart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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