Created
December 21, 2012 21:49
-
-
Save fnando/4356057 to your computer and use it in GitHub Desktop.
Open screen session and connect to given ssh domain.
Usage: $ ./prod example.org
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
| #!/usr/bin/env bash | |
| domain=$1 | |
| filename="/tmp/$(echo -n "$domain" | md5)" | |
| read -r -d '' screenrc <<SCREENRC | |
| startup_message off | |
| shell /usr/local/bin/bash | |
| autodetach on | |
| defscrollback 10000 | |
| defflow off | |
| hardstatus alwayslastline "%{= yd}%{+b }%t" | |
| escape ^Gg | |
| encoding UTF-8 | |
| screen -t "prod:$domain" | |
| stuff "ssh $domain\015" | |
| SCREENRC | |
| echo "$screenrc" | tee $filename | |
| screen -c $filename |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment