tmux_sessions.sh 1.2 KB

123456789101112131415161718192021222324252627282930
  1. #!/bin/sh
  2. # Start a tmux session of four ircd nodes, and optionally four weechat clients.
  3. set -e
  4. tmux new-session -s "darkirc" -n "darkirc" -d
  5. tmux send-keys "../../../../darkirc --config seed.toml" Enter && sleep 1
  6. tmux split-window -h
  7. tmux send-keys "../../../../darkirc --config ircd_full_node1.toml" Enter && sleep 1
  8. tmux split-window -h
  9. tmux send-keys "../../../../darkirc --config ircd_full_node2.toml" Enter
  10. tmux select-pane -t 0
  11. tmux split-window -v
  12. tmux send-keys "../../../../darkirc --config ircd_full_node3.toml" Enter
  13. tmux select-pane -t 2
  14. tmux split-window -v
  15. tmux send-keys "../../../../darkirc --config ircd_full_node4.toml" Enter
  16. if [ -z "$1" ]; then
  17. tmux new-window -t "darkirc:1" -n "weechat"
  18. tmux send-keys "weechat -t -r '/server add ircd_a 127.0.0.1/22022;/connect ircd_a;/nick Alice'" Enter
  19. tmux split-window -v
  20. tmux send-keys "weechat -t -r '/server add ircd_b 127.0.0.1/22023;/connect ircd_b;/nick Bob'" Enter
  21. tmux split-window -h
  22. tmux send-keys "weechat -t -r '/server add ircd_c 127.0.0.1/22024;/connect ircd_c;/nick Charlie'" Enter
  23. tmux select-pane -t 0
  24. tmux split-window -h
  25. tmux send-keys "weechat -t -r '/server add ircd_d 127.0.0.1/22025;/connect ircd_d;/nick Dave'" Enter
  26. fi
  27. tmux attach