-
Notifications
You must be signed in to change notification settings - Fork 0
/
cluster.sh
executable file
·34 lines (26 loc) · 1.23 KB
/
cluster.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
set -e # Exit on errors
if [ -n "$TMUX" ]; then
export NESTED_TMUX=1
export TMUX=''
fi
if [ ! $RC_DIR ]; then export RC_DIR=$HOME/src/redis-cluster; fi
export TERM=screen-256color-bce
tmux new-session -d -s redis-cluster
tmux send-key -t redis-cluster 'cd $RC_DIR/7001' Enter 'redis-server redis.conf' Enter
tmux split-window -t redis-cluster
tmux send-key -t redis-cluster 'cd $RC_DIR/7002' Enter 'redis-server redis.conf' Enter
tmux new-window -t redis-cluster -n ''
tmux send-key -t redis-cluster 'cd $RC_DIR/7003' Enter 'redis-server redis.conf' Enter
tmux split-window -t redis-cluster
tmux send-key -t redis-cluster 'cd $RC_DIR/7004' Enter 'redis-server redis.conf' Enter
tmux new-window -t redis-cluster -n ''
tmux send-key -t redis-cluster 'cd $RC_DIR/7005' Enter 'redis-server redis.conf' Enter
tmux split-window -t redis-cluster
tmux send-key -t redis-cluster 'cd $RC_DIR/7006' Enter 'redis-server redis.conf' Enter
#
if [ -z "$NESTED_TMUX" ]; then
tmux attach-session -t redis-cluster
else
tmux switch-client -t redis-cluster
fi