developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 1 | #!/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 | |
| 21 | BINPATH="/usr/bin" |
| 22 | GET="dmcli eRT getv" |
| 23 | SET="" |
| 24 | |
developer | 3d785cd | 2022-05-05 16:20:47 +0800 | [diff] [blame^] | 25 | echo "Fetching PAM Health status " |
developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 26 | |
developer | 3d785cd | 2022-05-05 16:20:47 +0800 | [diff] [blame^] | 27 | while [ 1 ] |
| 28 | do |
| 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 |
| 36 | done |
developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 37 | |
developer | 3d785cd | 2022-05-05 16:20:47 +0800 | [diff] [blame^] | 38 | echo "Fetching values to form parodus command line arguments" |
| 39 | ModelName=`$GET Device.DeviceInfo.ModelName | grep value| tr -s ' ' |cut -f5 -d" "` |
| 40 | SerialNumber=`$GET Device.DeviceInfo.SerialNumber | grep value| tr -s ' ' |cut -f5 -d" "` |
| 41 | Manufacturer=`$GET Device.DeviceInfo.Manufacturer | grep value| tr -s ' ' |cut -f5 -d" "` |
| 42 | HW_MAC=`ifconfig erouter0 | grep HWaddr | tr -s ' ' | cut -d ' ' -f5` |
| 43 | LastRebootReason=`$GET Device.DeviceInfo.X_RDKCENTRAL-COM_LastRebootReason | grep value| tr -s ' ' |cut -f5 -d" "` |
| 44 | FirmwareName=`$GET Device.DeviceInfo.X_CISCO_COM_FirmwareName | grep value| tr -s ' ' |cut -f5 -d" "` |
| 45 | BootTime=`$GET Device.DeviceInfo.X_RDKCENTRAL-COM_BootTime | grep value| tr -s ' ' |cut -f5 -d" "` |
| 46 | MaxPingWaitTimeInSec=180; |
| 47 | DeviceNetworkInterface="erouter0"; |
| 48 | #ServerURL=http://54.166.121.187:8080; |
| 49 | ServerURL=http://54.148.37.189:8080; |
| 50 | BackOffMax=9; |
| 51 | PARODUS_URL=tcp://127.0.0.1:6666; |
| 52 | SSL_CERT_PATH=/etc/ssl/certs/ca-certificates.crt |
developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 53 | |
developer | 3d785cd | 2022-05-05 16:20:47 +0800 | [diff] [blame^] | 54 | echo "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" |
| 56 | 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-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 " |
developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 57 | |
developer | 3d785cd | 2022-05-05 16:20:47 +0800 | [diff] [blame^] | 58 | echo "Starting parodus with the following arguments" |
| 59 | echo "$command" |
developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 60 | |
developer | 3d785cd | 2022-05-05 16:20:47 +0800 | [diff] [blame^] | 61 | $command & |