This repository has been archived by the owner on Jan 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDCMCronreschedule.sh
72 lines (59 loc) · 2.26 KB
/
DCMCronreschedule.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/sh
##########################################################################
# If not stated otherwise in this file or this component's Licenses.txt
# file the following copyright and licenses apply:
#
# Copyright 2016 RDK Management
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##########################################################################
#
. /etc/include.properties
. /etc/device.properties
# Enable override only for non prod builds
if [ "$BUILD_TYPE" != "prod" ] && [ -f $PERSISTENT_PATH/dcm.properties ]; then
. $PERSISTENT_PATH/dcm.properties
else
. /etc/dcm.properties
fi
if [ -f /lib/rdk/utils.sh ]; then
. /lib/rdk/utils.sh
fi
export PATH=$PATH:/usr/bin:/bin:/usr/local/bin:/sbin:/usr/local/lighttpd/sbin:/usr/local/sbin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/lib
if [ -z $LOG_PATH ]; then
LOG_PATH="$PERSISTENT_PATH/logs"
fi
if [ -z $PERSISTENT_PATH ]; then
PERSISTENT_PATH="/tmp"
fi
DCM_LOG_FILE="$LOG_PATH/dcmscript.log"
TELEMETRY_INOTIFY_FOLDER="/telemetry"
TELEMETRY_INOTIFY_EVENT="$TELEMETRY_INOTIFY_FOLDER/eventType.cmd"
echo "`date` Starting execution of DCMCronreshedule.sh" >> $DCM_LOG_FILE
PEER_COMM_ID="/tmp/elxrretyt-dcmc.swr"
IDLE_TIMEOUT=30
if [ "x$DCA_MULTI_CORE_SUPPORTED" == "xyes" ]; then
echo "Signal atom to pick the update_cronschedule data for schedule telemetry !!! " >> $DCM_LOG_FILE
## Trigger an inotify event on ATOM
if [ ! -f /usr/bin/GetConfigFile ];then
echo "Error: GetConfigFile Not Found"
exit 127
fi
if [ ! -f $PEER_COMM_ID ]; then
GetConfigFile $PEER_COMM_ID
fi
ssh -I $IDLE_TIMEOUT -i $PEER_COMM_ID root@$ATOM_INTERFACE_IP "/bin/echo 'update_cronschedule' > $TELEMETRY_INOTIFY_EVENT" > /dev/null 2>&1
else
sh /lib/rdk/dca_utility.sh 3 &
fi