Add shell functions to (un)bar Cells

This commit is contained in:
Keith Whyte 2021-12-11 07:07:32 +01:00
parent cd43e41eab
commit 94ba127039
2 changed files with 23 additions and 1 deletions

View file

@ -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 -%>

View file

@ -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