#!/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 RFSIMULATOR=server ./nr-softmodem --rfsim --sa -O ../../../ci-scripts/conf_files/gNB_SA_DU.conf' ENTER;

## Run OAI DU
tmux send-keys -t 1 'cd ~/oai/cmake_targets/ran_build/build/' ENTER \; send-keys -t 1 'sudo RFSIMULATOR=server ./nr-softmodem --rfsim --sa -O ../../../ci-scripts/conf_files/gNB_SA_CU.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
