Created
June 19, 2014 13:09
-
-
Save ruudud/bd75a332eb4ba13e5356 to your computer and use it in GitHub Desktop.
Poor-mans cssh
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/bash | |
# Based on https://github.com/dennishafemann/tmux-cssh/blob/master/tmux-cssh | |
tmux_session_name="multissh" | |
tmux new-session -d -s "${tmux_session_name}" "ssh $1" | |
shift | |
hosts="${@}" | |
for host in ${hosts[@]}; do | |
tmux split-window -h -t "${tmux_session_name}" "ssh ${host}" | |
done | |
# Set pane synchronisation | |
tmux set-window-option -t "${tmux_session_name}" synchronize-panes on | |
# Attach to tmux session | |
tmux attach-session -t "${tmux_session_name}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment