#!/bin/bash 
set +x 
tmux kill-session -t debug 
docker rm -f bob > /dev/null 
docker rm -f alice > /dev/null

# # Create network 
# docker network rm testnet
# docker network create testnet 


# Start Tmux with single docker container.
tmux new-session -d -s  debug docker run --network testnet --rm -it --name bob --hostname bobmachine  elixir:latest iex --sname bob --cookie cookie
sleep 2s
tmux split-window -h -t debug:0 docker run --network testnet --rm -it --name alice --hostname alicemachine elixir:latest iex --sname alice --cookie cookie
sleep 2s

# Add regular shell below each container.
tmux select-pane -t debug:0.0 
tmux split-window -v

tmux select-pane -t debug:0.2
tmux split-window -v

tmux select-pane -t debug:0.0
tmux attach -d -t debug