session="cardano-db-sync"
# Check if the session exists, discarding output
# We can check $? for the exit status (zero for success, non-zero for failure)
tmux has-session -t $session 2>/dev/null
tmux attach-session -t $session
tmux new -s "cardano-db-sync" -n "node" -d
tmux select-pane -t 'cardano-db-sync:node.0'
tmux send-keys -t 'cardano-db-sync:node.0' './init-cardano-db.sh' Enter
tmux send-keys -t 'cardano-db-sync:node.1' 'htop' Enter
tmux send-keys -t 'cardano-db-sync.2' 'nload' Enter
tmux attach-session -t $session