Created
March 19, 2019 02:51
-
-
Save godber/baea748729740082f66863414071da73 to your computer and use it in GitHub Desktop.
Example scripting tmux - bootstrap a kafka session in
This file contains hidden or 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
#!/usr/bin/env bash | |
cd temp/kafka_2.12-2.1.1/ | |
SESSION='kafka' | |
tmux ls | grep -q $SESSION | |
if [ $? -eq 0 ]; then | |
tmux a -t $SESSION | |
else | |
tmux -2 new-session -d -s $SESSION | |
tmux new-window | |
tmux send-keys 'bin/zookeeper-server-start.sh config/zookeeper.properties' C-m | |
tmux rename-window 'zookeeper' | |
tmux new-window | |
tmux send-keys 'sleep 20; bin/kafka-server-start.sh config/server.properties' C-m | |
tmux rename-window 'kafka' | |
tmux -2 attach-session -t $SESSION | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment