diff --git a/modules/rhizo_base/files/bin/check_amp_status.sh b/modules/rhizo_base/files/bin/check_amp_status.sh index cb2aebb..87ddc54 100755 --- a/modules/rhizo_base/files/bin/check_amp_status.sh +++ b/modules/rhizo_base/files/bin/check_amp_status.sh @@ -2,7 +2,7 @@ # Check for AMP status on each BTS, from BTS1 up to BTS3 RHIZO_SCRIPT="/home/rhizomatica/bin" . $RHIZO_SCRIPT/vars.sh -for bts in $BTS1 $BTS2 $BTS3; do +for bts in $BTS0 $BTS1 $BTS2; do echo "BTS $bts:"; ssh root@$bts sbts2050-util sbts2050-pwr-status | grep Amp; done diff --git a/modules/rhizo_base/files/bin/check_broken.sh b/modules/rhizo_base/files/bin/check_broken.sh index 7b05a0f..88ca89a 100755 --- a/modules/rhizo_base/files/bin/check_broken.sh +++ b/modules/rhizo_base/files/bin/check_broken.sh @@ -8,7 +8,7 @@ NACK=`echo "show lchan" | nc -q1 localhost 4242 | grep "BROKEN UNUSABLE Error re if [ $NACK -gt 0 ]; then waitfor0calls _bts=0 - for bts in $BTS1 $BTS2 $BTS3; do + for bts in $BTS0 $BTS1 $BTS2; do echo "Dropping BTS connection $_bts due to $NACK broken (NACK) Channels" echo -e "enable\n drop bts connection $_bts oml" | nc -q1 localhost 4242 done diff --git a/modules/rhizo_base/files/bin/get_position.sh b/modules/rhizo_base/files/bin/get_position.sh index 74bfc78..05f8df6 100755 --- a/modules/rhizo_base/files/bin/get_position.sh +++ b/modules/rhizo_base/files/bin/get_position.sh @@ -3,7 +3,7 @@ RHIZO_SCRIPT="/home/rhizomatica/bin" . $RHIZO_SCRIPT/vars.sh n=0 -for bts in $BTS1 $BTS2 $BTS3; do +for bts in $BTS0 $BTS1 $BTS2; do echo "BTS $bts:"; let "n++" #ssh root@$bts "/etc/init.d/gpsd stop ; sleep 1 ;/etc/init.d/gpsd start; sleep 1" diff --git a/modules/rhizo_base/files/bin/turn_off_amplifier.sh b/modules/rhizo_base/files/bin/turn_off_amplifier.sh index b7561e6..6810a5d 100755 --- a/modules/rhizo_base/files/bin/turn_off_amplifier.sh +++ b/modules/rhizo_base/files/bin/turn_off_amplifier.sh @@ -4,7 +4,7 @@ RHIZO_SCRIPT="/home/rhizomatica/bin" . $RHIZO_SCRIPT/vars.sh LOGFILE="/var/log/monitor_amp.log" -for bts in $BTS1 $BTS2 $BTS3; do +for bts in $BTS0 $BTS1 $BTS2; do logc "Turning off AMP on BTS $bts:"; ssh root@$bts "sbts2050-util sbts2050-pwr-enable 1 1 0"; done diff --git a/modules/rhizo_base/files/bin/turn_on_amplifier.sh b/modules/rhizo_base/files/bin/turn_on_amplifier.sh index 58836f6..16ce888 100755 --- a/modules/rhizo_base/files/bin/turn_on_amplifier.sh +++ b/modules/rhizo_base/files/bin/turn_on_amplifier.sh @@ -4,7 +4,7 @@ RHIZO_SCRIPT="/home/rhizomatica/bin" . $RHIZO_SCRIPT/vars.sh LOGFILE="/var/log/monitor_amp.log" -for bts in $BTS1 $BTS2 $BTS3; do +for bts in $BTS0 $BTS1 $BTS2; do logc "Turning on AMP on BTS $bts:"; ssh root@$bts "sbts2050-util sbts2050-pwr-enable 1 1 1"; done diff --git a/modules/rhizo_base/templates/vars.sh.erb b/modules/rhizo_base/templates/vars.sh.erb index dfab1f0..8122505 100644 --- a/modules/rhizo_base/templates/vars.sh.erb +++ b/modules/rhizo_base/templates/vars.sh.erb @@ -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 }