#!/bin/bash

sudo apt-get install tmux -y

session="oai"

## Split into 4 panes
tmux new-session -d -s $session
tmux split-window -h \; split-window -d;

## Run OAI RAN

## Run OAI CU
tmux send-keys -t 0 'cd ~/oai/cmake_targets/ran_build/build/' ENTER \; send-keys -t 0 'sudo ./nr-softmodem -E --sa -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf' ENTER;

## Run OAI DU
tmux send-keys -t 1 'cd ~/oai/cmake_targets/ran_build/build/' ENTER \; send-keys -t 1 'sudo ./nr-softmodem -E --sa -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf' ENTER;

## Run FlexRIC
tmux send-keys -t 2 'cd ~/flexric/' ENTER \; send-keys -t 2 './build/examples/ric/nearRT-RIC' ENTER;

tmux attach-session -t $session
