Skip to content

@objectified /uberssh.sh
Last active

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Simple shell script that wraps tmux to simulate clusterssh behaviour, while not needing X and having all the advantages of tmux. Run as: ./uberssh.sh my_session_name host1 host2 host3To toggle between input synchronization, use "ctrl+b u".
#!/bin/bash
TMUX_PATH="/usr/bin/tmux"
SESS_NAME="$1"
shift
HOSTS="$*"
let ctr=0
for h in $HOSTS; do
if [ $ctr -eq 0 ]; then
$TMUX_PATH new-session -d -s $SESS_NAME "ssh $h"
else
$TMUX_PATH splitw -t $SESS_NAME:0 "ssh $h"
$TMUX_PATH select-layout -t $SESS_NAME:0 tiled
fi
let ctr=ctr+1
done
$TMUX_PATH set-window-option -t $SESS_NAME:0 synchronize-panes on
$TMUX_PATH select-pane -t $SESS_NAME:0
$TMUX_PATH bind-key u set-window-option synchronize-panes
$TMUX_PATH attach -t $SESS_NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.