Skip to content

Instantly share code, notes, and snippets.

@ayust
Created November 30, 2012 21:21

Revisions

  1. ayust created this gist Nov 30, 2012.
    9 changes: 9 additions & 0 deletions fluttermosh.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    #!/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"