blob: 70655b65566eade734362e5a8b14d1b1b414fff3 [file] [log] [blame]
developer15a43312022-04-12 11:23:23 +08001#!/bin/sh
2##########################################################################
3# If not stated otherwise in this file or this component's Licenses.txt
4# file the following copyright and licenses apply:
5#
6# Copyright 2018 RDK Management
7#
8# Licensed under the Apache License, Version 2.0 (the "License");
9# you may not use this file except in compliance with the License.
10# You may obtain a copy of the License at
11#
12# http://www.apache.org/licenses/LICENSE-2.0
13#
14# Unless required by applicable law or agreed to in writing, software
15# distributed under the License is distributed on an "AS IS" BASIS,
16# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17# See the License for the specific language governing permissions and
18# limitations under the License.
19##########################################################################
20#
21##################################################################
22## Script to start Device Configuration Management script
23## Author: Ajaykumar/Shakeel/Suraj
24##################################################################
25. /etc/include.properties
26
27
28if [ -f "$RDK_PATH/DCMscript.sh" ]
29then
30 if [ -f "$TELEMETRY_JSON_RESPONSE" ]; then
31 echo "remove previous json resp"
32 rm -f $TELEMETRY_JSON_RESPONSE
33 rm -f $PERSISTENT_PATH/*TELE*
34 fi
35 sh /lib/rdk/DCMscript.sh $DCM_LOG_SERVER $DCM_LOG_SERVER_URL $LOG_SERVER 0 1 >> /rdklogs/logs/telemetry.log &
36 sleep 10
37 fileRetryCount=0
38 while [ $fileRetryCount -ne 120 ]
39 do
40 echo "Trying to check if rtl_json files exists ..."
41 if [ -f "/nvram/rtl_json.txt" ]; then
42 echo "files exists !!!!..."
43 #sh $RDK_PATH/DCMscript-log.sh $DCM_LOG_SERVER $DCM_LOG_SERVER_URL $LOG_SERVER 0 1 >> /rdklogs/logs/logupload.log &
44 sleep 5
45 proUpdel=`cat /tmp/DCMSettings.conf | grep -i uploadRepository:uploadProtocol | tr -dc '"' |wc -c`
46 echo "number of proUPdel:"$proUpdel
47 #proUpdel=$((proUpdel - 1))
48 uploadProto=`cat /tmp/DCMSettings.conf | grep -i urn:settings:TelemetryProfile | cut -d '"' -f$proUpdel`
49 echo "Upload protocol is:"$uploadProto
50 if [ "$uploadProto" != "TFTP" ]; then
51 HTTPLOGUPLOADURL=`cat /tmp/DCMSettings.conf | grep -i "urn:settings:LogUploadSettings:RepositoryURL" | cut -d "=" -f2`
52 if [ "$HTTPLOGUPLOADURL" == "" ]; then
53 echo "No HTTP URL configured in xconf,going with internal one !!"
54 HTTPLOGUPLOADURL=$DCM_LA_SERVER_URL
55 fi
56 echo "HTTPURL:"$HTTPLOGUPLOADURL
57 sh $RDK_PATH/uploadSTBLogs.sh $HTTPLOGUPLOADURL 1 1 1 0 0 &
58 break
59 else
60 delimnr=`cat /tmp/DCMSettings.conf | grep -i urn:settings:TelemetryProfile | tr -dc ':' |wc -c`
61 echo "number of deli:"$delimnr
62 delimnr=$((delimnr - 1))
63 TFTPIP=`cat /tmp/DCMSettings.conf | grep -i urn:settings:TelemetryProfile | cut -d ":" -f$delimnr | cut -d '"' -f 2`
64 echo "TFTPIP:"$TFTPIP
65 sleep 5
66 sh $RDK_PATH/uploadSTBLogs.sh $TFTPIP 1 1 1 0 0 &
67 break
68 fi
69 else
70 echo "still file is not there sleep for 5 sec"$fileRetryCount
71 sleep 5
72 fi
73 fileRetryCount=`expr $fileRetryCount + 1`
74 done
75else
76 echo "$RDK_PATH/DCMscript.sh file not found."
77fi