Skip to content

Instantly share code, notes, and snippets.

@gngdb gngdb/mosh-algo
Created Sep 9, 2019

Embed
What would you like to do?
Script for easy mosh connections
#!/bin/bash
ALGO_IP=`ip addr | awk '
/^[0-9]+:/ {
sub(/:/,"",$2); iface=$2 }
/^[[:space:]]*inet / {
split($2, a, "/")
print iface" : "a[1]
}' | grep tun | cut -b 8- | cut -d "." -f 1-3 | sed 's/$/.1/'`
mosh --ssh="ssh -i algo.pem" ubuntu@$ALGO_IP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.