From 94ba12703954418a1de19e420f4bc2aa8add9a0a Mon Sep 17 00:00:00 2001 From: Keith Whyte Date: Sat, 11 Dec 2021 07:07:32 +0100 Subject: [PATCH] Add shell functions to (un)bar Cells --- modules/rhizo_base/templates/osmo-bsc-bts.erb | 2 +- .../templates/rccn-functions.sh.erb | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/modules/rhizo_base/templates/osmo-bsc-bts.erb b/modules/rhizo_base/templates/osmo-bsc-bts.erb index e1357fd..3d1fbac 100644 --- a/modules/rhizo_base/templates/osmo-bsc-bts.erb +++ b/modules/rhizo_base/templates/osmo-bsc-bts.erb @@ -24,7 +24,7 @@ oml ipa stream-id 255 line 0 neighbor-list mode automatic <% @bts.each_with_index do |b, i| -%> -<% if i != index -%> +<% if i < index -%> neighbor bts <%= i %> <% end -%> <% end -%> diff --git a/modules/rhizo_base/templates/rccn-functions.sh.erb b/modules/rhizo_base/templates/rccn-functions.sh.erb index b8eea5e..c233f9c 100644 --- a/modules/rhizo_base/templates/rccn-functions.sh.erb +++ b/modules/rhizo_base/templates/rccn-functions.sh.erb @@ -169,6 +169,28 @@ unlock () { expect "#"; send "exit\r"; expect "#"; send "exit\r"; expect "#"; send "exit\r"; expect "#"; send "exit\r"; expect "#"'; } +bar () +{ + if [ "$1" == "" ]; then + echo "BTS #?"; + return; + fi; + expect -c 'set bts '$1'; spawn telnet localhost 4242; expect ">"; send "enable\r"; expect "#"; send "configure terminal\r"; expect "#"; + send "network\r"; expect "#"; send "bts $bts\r"; expect "#"; send "cell barred 1\r"; expect "#"; send "exit \r"; + expect "#"; send "exit\r"; expect "#"; send "exit\r"; expect "#"; send "bts $bts resend-system-information\r"; expect "#"; send "exit\r"; expect "#"' +} + +unbar () +{ + if [ "$1" == "" ]; then + echo "BTS #?"; + return; + fi; + expect -c 'set bts '$1'; spawn telnet localhost 4242; expect ">"; send "enable\r"; expect "#"; send "configure terminal\r"; expect "#"; + send "network\r"; expect "#"; send "bts $bts\r"; expect "#"; send "cell barred 0\r"; expect "#"; send "exit \r"; + expect "#"; send "exit\r"; expect "#"; send "exit\r"; expect "#"; send "bts $bts resend-system-information\r"; expect "#"; send "exit\r"; expect "#"' +} + red () { if [ "$1" == "" ]; then