Last active
December 28, 2015 10:59
-
-
Save zipizap/7489927 to your computer and use it in GitHub Desktop.
Detect ssh login from ~/.bashrc
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
# If you put this check inside ~/.bashrc you can detect bash session opened by ssh-logins :) | |
[ "$SSH_CONNECTION" -a "$SSH_TTY" == $(tty) ] && echo "This bash session was opened from an ssh login :)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment