Build BTS defs in vars.sh from array

and, Number the BTS from 0 in environment
This commit is contained in:
Keith Whyte 2020-04-29 00:30:41 +02:00
parent e2e8c76b70
commit 0e360b2194
6 changed files with 10 additions and 19 deletions

View file

@ -8,14 +8,8 @@ function logc() {
#BTSs IP addresses
<% if @bts1_ip_address -%>
BTS1=<%= @bts1_ip_address %>
<% end -%>
<% if @bts2_ip_address -%>
BTS2=<%= @bts2_ip_address %>
<% end -%>
<% if @bts3_ip_address -%>
BTS3=<%= @bts3_ip_address %>
<% @bts.each_with_index do |bts, index| -%>
BTS<%= index %>=<%= bts["ip"] %>
<% end -%>
LATENCY_HOST=<%= @latency_check_address %>
@ -27,11 +21,8 @@ RECIPIENTS="<%= @mail_admins -%>"
function bname {
case $1 in
0) echo -n "<%= @bts1_name %> ONE" ;;
1) echo -n "<%= @bts1_name %> TWO" ;;
2) echo -n "<%= @bts2_name %> ONE" ;;
3) echo -n "<%= @bts2_name %> TWO" ;;
4) echo -n "<%= @bts3_name %> ONE" ;;
5) echo -n "<%= @bts3_name %> TWO" ;;
<% @bts.each_with_index do |bts, index| -%>
<%= index %>) echo -n "<%= bts["name"] %>" ;;
<% end -%>
esac
}