diff --git a/modules/rhizo_base/files/var/SysmoBTS/check.sh b/modules/rhizo_base/files/var/SysmoBTS/check.sh new file mode 100644 index 0000000..1683d27 --- /dev/null +++ b/modules/rhizo_base/files/var/SysmoBTS/check.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +exec 2> /dev/null + +SSH_OPTS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" +. /home/rhizomatica/bin/vars.sh + + +for bts in "${!BTS[@]}" ; do + + if [ "$(ssh $SSH_OPTS ${BTS[$bts]} sysmobts-util trx-nr)" == "0" ] ; then + # Master Verified. + echo "BTS $bts is a 2050 Master" + fi + + if [ "$(ssh $SSH_OPTS ${BTS[$bts]} sysmobts-util trx-nr)" == "1" ] ; then + # Slave Verified. + echo "BTS $bts is a 2050 Slave" + fi + +done diff --git a/modules/rhizo_base/manifests/init.pp b/modules/rhizo_base/manifests/init.pp index cbce566..4fcf032 100644 --- a/modules/rhizo_base/manifests/init.pp +++ b/modules/rhizo_base/manifests/init.pp @@ -479,8 +479,16 @@ schedule { 'repo': } file { '/var/SysmoBTS': - ensure => present, + ensure => directory, source => 'puppet:///modules/rhizo_base/var/SysmoBTS', + owner => 'root', + group => 'root', + recurse => remote + } + + file { '/var/SysmoBTS/check.sh': + source => 'puppet:///modules/rhizo_base/var/SysmoBTS/check.sh', + mode => '0750' } file { '/var/log/rccn':