blob: f65e633849db4e821b806ec54f1dbbd2f7864b86 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# Using shell scripting to setup your tmux environment #
Can use a simple bootstrap script to setup tmux environment and log into it.
example script
`#!/bin/sh`
`tmux new-session -d -s hawkhost`
`tmux new-window -t hawkhost:1 -n 'Server1' 'ssh root@10.x.x.x'`
`tmux new-window -t hawkhost:2 -n 'Server2' 'ssh root@10.x.x.x'`
`tmux new-window -t hawkhost:3 -n 'Server3' 'ssh root@10.x.x.x'`
`tmux new-window -t hawkhost:4 -n 'Server4' 'ssh root@10.x.x.x'`
`tmux new-window -t hawkhost:5 -n 'Server5' 'ssh root@10.x.x.x'`
`tmux select-window -t hawkhost:1`
`tmux -2 attach-session -t hawkhost`
`new-session -d -s hawkhost` creates new session, names it and detaches it.
The new-window commands create 5 new windows and executes the commands.
The last two commands sets the active window and then attaches to the session
|