Created
November 30, 2012 21:21
-
-
Save ayust/4178719 to your computer and use it in GitHub Desktop.
Wrapper for mosh that makes it work on systems where mosh doesn't seem to want to parse properly
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
#!/bin/bash | |
set -e | |
MOSH_IP="$(host -cIN "$1" | cut -d' ' -f4)" | |
MOSH_CONNECT_INFO="$(ssh -t "$1" -- "mosh-server" | grep "MOSH CONNECT" | tr -d '\r' | cut -d' ' -f3,4)" | |
read MOSH_PORT MOSH_KEY <<<"$MOSH_CONNECT_INFO" | |
MOSH_KEY="$MOSH_KEY" exec mosh-client "$MOSH_IP" "$MOSH_PORT" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment