blob: 78397cfad25ee2a73b0cfa842a78d544da9274ae [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 2020 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
21BINPATH="/usr/bin"
22GET="dmcli eRT getv"
23SET=""
24
developer3d785cd2022-05-05 16:20:47 +080025echo "Fetching PAM Health status "
developer15a43312022-04-12 11:23:23 +080026
developer3d785cd2022-05-05 16:20:47 +080027while [ 1 ]
28do
29 pamState=`$GET com.cisco.spvtg.ccsp.pam.Health | grep value| tr -s ' ' |cut -f5 -d" "`
30 if [ "$pamState" = "Green" ]; then
31 break
32 else
33 echo "Waiting for PAM to come up"
34 fi
35 sleep 10
36done
developer15a43312022-04-12 11:23:23 +080037
developer3d785cd2022-05-05 16:20:47 +080038echo "Fetching values to form parodus command line arguments"
39ModelName=`$GET Device.DeviceInfo.ModelName | grep value| tr -s ' ' |cut -f5 -d" "`
40SerialNumber=`$GET Device.DeviceInfo.SerialNumber | grep value| tr -s ' ' |cut -f5 -d" "`
41Manufacturer=`$GET Device.DeviceInfo.Manufacturer | grep value| tr -s ' ' |cut -f5 -d" "`
42HW_MAC=`ifconfig erouter0 | grep HWaddr | tr -s ' ' | cut -d ' ' -f5`
43LastRebootReason=`$GET Device.DeviceInfo.X_RDKCENTRAL-COM_LastRebootReason | grep value| tr -s ' ' |cut -f5 -d" "`
44FirmwareName=`$GET Device.DeviceInfo.X_CISCO_COM_FirmwareName | grep value| tr -s ' ' |cut -f5 -d" "`
45BootTime=`$GET Device.DeviceInfo.X_RDKCENTRAL-COM_BootTime | grep value| tr -s ' ' |cut -f5 -d" "`
46MaxPingWaitTimeInSec=180;
47DeviceNetworkInterface="erouter0";
48#ServerURL=http://54.166.121.187:8080;
49ServerURL=http://54.148.37.189:8080;
50BackOffMax=9;
51PARODUS_URL=tcp://127.0.0.1:6666;
52SSL_CERT_PATH=/etc/ssl/certs/ca-certificates.crt
developer15a43312022-04-12 11:23:23 +080053
developer3d785cd2022-05-05 16:20:47 +080054echo "Framing command for parodus"
55#command="/usr/bin/parodus --hw-model=$ModelName --hw-serial-number=$SerialNumber --hw-manufacturer=$Manufacturer --hw-mac=$HW_MAC --hw-last-reboot-reason=$LastRebootReason --fw-name=$FirmwareName --boot-time=$BootTime --webpa-ping-time=$MaxPingWaitTimeInSec --webpa-inteface-used=$DeviceNetworkInterface --webpa-url=$ServerURL --webpa-backoff-max=$BackOffMax"
56command="/usr/bin/parodus --hw-model=$ModelName --hw-serial-number=$SerialNumber --hw-manufacturer=$Manufacturer --hw-mac=$HW_MAC --hw-last-reboot-reason=$LastRebootReason --fw-name=$FirmwareName --boot-time=$BootTime --webpa-ping-time=$MaxPingWaitTimeInSec --webpa-interface-used=$DeviceNetworkInterface --webpa-url=$ServerURL --webpa-backoff-max=$BackOffMax --parodus-local-url=$PARODUS_URL --partner-id=comcast --ssl-cert-path=$SSL_CERT_PATH --force-ipv4 "
developer15a43312022-04-12 11:23:23 +080057
developer3d785cd2022-05-05 16:20:47 +080058echo "Starting parodus with the following arguments"
59echo "$command"
developer15a43312022-04-12 11:23:23 +080060
developer3d785cd2022-05-05 16:20:47 +080061$command &