Last active
March 7, 2017 10:33
-
-
Save hukl/7907348 to your computer and use it in GitHub Desktop.
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
# ZSH Script to open a tmux session for every host passed as CLI argument and synchronizes all the panes. | |
# Invoke with: ./cluster.zsh user@host1 user@host2 user@host3 | |
#!/bin/zsh | |
while (( $# != 0 )) { | |
tmux splitw "ssh $1" | |
tmux select-layout tiled | |
shift | |
} | |
tmux set-window-option synchronize-panes on | |
# You can make an alias in your shell as a shortcut to command your servers with ease: | |
alias cluster_control="tmux new 'exec ./cluster.zsh user@host1 user@host2 user@host3'" | |
# Inspired by http://perlstalker.vuser.org/blog/2013/09/24/cluster-ssh-with-tmux/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Of course this can be easily adopted to other shells