Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- starttmux() {
- if [ -z "$HOSTS" ]; then
- echo -n "Please provide of list of hosts separated by spaces [ENTER]: "
- read HOSTS
- fi
- if [ -z "$PORT" ]; then
- echo -n "Please provide port [ENTER]: "
- read PORT
- fi
- local hosts=( $HOSTS )
- tmux new-window "ssh ${hosts[0]}"
- #unset hosts[0];
- for i in "${hosts[@]}"; do
- tmux split-window -h "ssh $i -p $PORT"
- tmux select-layout tiled > /dev/null
- done
- tmux select-pane -t 0
- tmux set-window-option synchronize-panes on > /dev/null
- }
- HOSTS=${HOSTS:=$*}
- starttmux
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement