Last active
December 27, 2015 02:59
-
-
Save frankamp/7256572 to your computer and use it in GitHub Desktop.
practical, up-enter friendly, multiple parameter friendly, ssh + fallthrough tmux->screen->bash for painless session resuming
This file contains hidden or 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
# Usage: sssh name_of_session *ssh_args | |
# ex: sssh a -i identity.pem [email protected] | |
# will connect to or create session "a" on remote server with a certain identity | |
# Requires: bash. | |
# function needs to be exported into your shell, ex: put in .bashrc near aliases | |
# keep this handy http://www.mechanicalkeys.com/files/os/notes/tm.html | |
sssh() { | |
session="$1" | |
shift | |
ssh -t $@ "tmux a -t $session || tmux new -s $session || screen -S $session -dr || screen -S $session || /bin/bash" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment