Created
July 25, 2017 05:42
-
-
Save gkeramidas/c8f9f47e3e350994d2fd985d553e39c8 to your computer and use it in GitHub Desktop.
mosh/tmux wrapper for named tmux sessions
This file contains 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/sh | |
progname=$(basename $0) | |
now() { | |
date '+%m%d %H:%M:%S' | |
} | |
err() { | |
errcode=$1 | |
shift | |
echo >&2 "E$(now) [${progname}] $*" | |
exit $errcode | |
} | |
if test $# -ne 1 ; then | |
err 1 "No session name specified" | |
fi | |
session_name="$1" | |
if test -z "$session_name" ; then | |
err 1 "Empty session name" | |
fi | |
exec mosh -6 -- \ | |
devserver \ | |
tmux -L "${session_name}" \ | |
new-session -A -s "${session_name}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment