Skip to content

Instantly share code, notes, and snippets.

@kinkerl
Created May 9, 2012 08:51
Show Gist options
  • Save kinkerl/2643101 to your computer and use it in GitHub Desktop.
Save kinkerl/2643101 to your computer and use it in GitHub Desktop.
mosh failover to regular shell, took from https://github.com/keithw/mosh/issues/232
#!/usr/bin/env bash
mosh "$@"
[ $? -eq 5 ] && ssh "$@"
@mbrevda
Copy link

mbrevda commented Jun 5, 2012

why a return code of 5? I'm getting 127

How about anything greater than 0?

@kinkerl
Copy link
Author

kinkerl commented Jun 6, 2012

that may be fine as well. i was getting 5 if the server only knows ssh and i only wanted to use ssh in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment