mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-13 04:30:28 +00:00
- all RAN code, CI code, configuration files, dockerfiles, in CSSL v1.0
- all deployment code (openshift, charts, ancillary files like shell
scripts), in MIT
- documentation in CC-BY-4.0
- exceptions might apply and are listed in NOTICE
- there is a new LICENSES folder with all licenses
- CONTRIBUTIONS.md has been updated accordingly
For automated changes based on OAI PL v1.1:
perl -i~ -0pe 's/\/\*.*Licensed to the OpenAirInterface.*openairinterface.org\n#?/\/*\n * SPDX-License-Identifier: LicenseRef-CSSL-1.0\n/s' **/*.{c,h,cpp}
perl -i~ -0pe 's/\/\*.*Licensed to the OpenAirInterface.*openairinterface.org\n#?/\/*\n * SPDX-License-Identifier: LicenseRef-CSSL-1.0\n/s' **/*.ts
perl -i~ -0pe 's/<!--.*Licensed to the OpenAirInterface.*openairinterface.org\n.*-->/<!-- SPDX-License-Identifier: LicenseRef-CSSL-1.0 -->/s' **/*.xml
The rest (cmake, files with missing license, cmake) manually.
95 lines
2.0 KiB
Bash
95 lines
2.0 KiB
Bash
#!/bin/bash
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
if [ -z "$1" ]; then
|
|
echo "Usage: $0 <bandwidth> [reboot]"
|
|
exit 1
|
|
fi
|
|
|
|
BANDWIDTH="$1"
|
|
DO_REBOOT="$2"
|
|
RU_IP="10.10.0.115"
|
|
HOST="root@$RU_IP"
|
|
LOGFILE="/tmp/radio_config_$(date +%Y%m%d_%H%M%S).log"
|
|
|
|
echo "=== Starting at $(date) ===" | tee "$LOGFILE"
|
|
echo "Target bandwidth: $BANDWIDTH" | tee -a "$LOGFILE"
|
|
echo "Reboot before configuration: ${DO_REBOOT:-no}" | tee -a "$LOGFILE"
|
|
|
|
if [ "$DO_REBOOT" == "reboot" ]; then
|
|
echo "=== Rebooting RU ($RU_IP) ... ===" | tee -a "$LOGFILE"
|
|
|
|
expect <<EOF | tee -a "$LOGFILE" > /dev/null 2>&1
|
|
set timeout 10
|
|
spawn ssh -tt $HOST
|
|
|
|
expect "#"
|
|
send "reboot\r"
|
|
expect "Continue?"
|
|
send "Y\r"
|
|
# We expect disconnect now
|
|
expect eof
|
|
EOF
|
|
|
|
echo "→ Waiting for $RU_IP SSH to go down..." | tee -a "$LOGFILE"
|
|
sleep 10
|
|
|
|
echo "→ Waiting for $RU_IP SSH port 22 to be open..." | tee -a "$LOGFILE"
|
|
while ! nc -zv $RU_IP 22 >/dev/null 2>&1; do
|
|
echo "SSH port 22 not open, waiting 5 seconds..." | tee -a "$LOGFILE"
|
|
sleep 5
|
|
done
|
|
echo "✓ SSH port 22 is open on $RU_IP" | tee -a "$LOGFILE"
|
|
fi
|
|
|
|
echo "=== Applying bandwidth configuration ===" | tee -a "$LOGFILE"
|
|
|
|
expect <<EOF | tee -a "$LOGFILE" > /dev/null 2>&1
|
|
set timeout 10
|
|
spawn ssh -tt $HOST
|
|
|
|
expect "#"
|
|
send "radio disable\r"
|
|
|
|
expect "#"
|
|
send "config\r"
|
|
|
|
expect "(config)#"
|
|
send "radio 1\r"
|
|
|
|
expect "(conf-rf 1)#"
|
|
send "bandwidth ${BANDWIDTH}\r"
|
|
|
|
expect "(conf-rf 1)#"
|
|
send "exit\r"
|
|
|
|
expect "(config)#"
|
|
send "exit\r"
|
|
|
|
expect "#"
|
|
send "radio enable\r"
|
|
|
|
expect "#"
|
|
send "show running-config\r"
|
|
|
|
expect "#"
|
|
send "exit\r"
|
|
EOF
|
|
|
|
echo "=== Checking bandwidth in running-config ===" | tee -a "$LOGFILE"
|
|
|
|
FOUND_BW=$(grep -E "bandwidth[[:space:]]+[0-9]+" "$LOGFILE" \
|
|
| tail -n 1 \
|
|
| awk '{print $2}' \
|
|
| tr -d '\r[:space:]')
|
|
|
|
if [ "$FOUND_BW" -eq "$BANDWIDTH" ]; then
|
|
echo "✓ SUCCESS: Bandwidth correctly set to $FOUND_BW" | tee -a "$LOGFILE"
|
|
rm "$LOGFILE"
|
|
exit 0
|
|
else
|
|
echo "✖ ERROR: Expected bandwidth $BANDWIDTH but found: $FOUND_BW" | tee -a "$LOGFILE"
|
|
exit 1
|
|
fi
|
|
|