From e765806d65f25fbb57a50d67ad1f387e7f2996d4 Mon Sep 17 00:00:00 2001 From: Keith Whyte Date: Wed, 2 Jun 2021 20:26:35 +0200 Subject: [PATCH] Add shell func to modify bts max_power_red --- modules/rhizo_base/templates/rccn-functions.sh.erb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/modules/rhizo_base/templates/rccn-functions.sh.erb b/modules/rhizo_base/templates/rccn-functions.sh.erb index 5833ae8..cda34b2 100644 --- a/modules/rhizo_base/templates/rccn-functions.sh.erb +++ b/modules/rhizo_base/templates/rccn-functions.sh.erb @@ -164,3 +164,17 @@ unlock () { send "network\r"; expect "#"; send "bts $bts\r"; expect "#"; send "trx 0\r"; expect "#"; send "rf_locked 0\r"; expect "#"; send "exit\r"; expect "#"; send "exit\r"; expect "#"; send "exit\r"; expect "#"; send "exit\r"; expect "#"'; } + +red () +{ + if [ "$1" == "" ]; then + echo "BTS #?"; + return; + fi; + if [ "$2" == "" ]; then + echo "Power Reduction?"; + return; + fi; + expect -c 'set bts '$1'; set red '$2'; spawn telnet localhost 4242; expect ">"; send "enable\r"; expect "#"; send "configure terminal\r"; expect "#"; + send "network\r"; expect "#"; send "bts $bts\r"; expect "#"; send "trx 0\r"; expect "#"; send "max_power_red $red\r"; + expect "#"; send "exit\r"; expect "#"; send "exit\r"; expect "#"; send "exit\r"; expect "#"; send "exit\r"; expect "#"'