Skip to content

Instantly share code, notes, and snippets.

@mbarkhau
Last active February 6, 2019 18:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbarkhau/4f5ee6d716423e13c35e628c55600365 to your computer and use it in GitHub Desktop.
Save mbarkhau/4f5ee6d716423e13c35e628c55600365 to your computer and use it in GitHub Desktop.
tmussh
#!/bin/bash
bash /home/mbarkhau/bin/tmush mbarkhau@localhost
#!/bin/bash
if [[ "$#" -eq 0 ]]; then
echo "1 argument required, $# provided";
exit 1;
fi
addr="$1";
if [[ "$#" -eq 1 ]]; then
session_name="mb";
else
session_name=$2;
fi
mosh $addr -- sh -c "tmux -2 attach -dt $session_name || tmux new-session -s $session_name;"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment