From 3becae1f23cb793f8514ae636e85372a70210210 Mon Sep 17 00:00:00 2001 From: Keith Whyte Date: Wed, 29 Apr 2020 03:48:57 +0200 Subject: [PATCH] Adding skeleton test file to BTS scripts --- .../rhizo_base/files/var/SysmoBTS/check.sh | 21 +++++++++++++++++++ modules/rhizo_base/manifests/init.pp | 10 ++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 modules/rhizo_base/files/var/SysmoBTS/check.sh 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':