xref: /openbmc/openpower-vpd-parser/scripts/wait-vpd-status.sh (revision fa5e4d325ef9cea3c841fe89d202c340f92bd8c6)
1*fa5e4d32SSunny Srivastava#!/bin/sh
2*fa5e4d32SSunny Srivastavaretries=100
3*fa5e4d32SSunny Srivastavaecho "Checking every 2s for VPD collection status ...."
4*fa5e4d32SSunny Srivastavawhile [ "$retries" -ne 0 ]
5*fa5e4d32SSunny Srivastavado
6*fa5e4d32SSunny Srivastava    sleep 2
7*fa5e4d32SSunny Srivastava    output=$(busctl get-property com.ibm.VPD.Manager /com/ibm/VPD/Manager com.ibm.VPD.Manager CollectionStatus)
8*fa5e4d32SSunny Srivastava
9*fa5e4d32SSunny Srivastava    if echo "$output" | grep -q "Completed" ; then
10*fa5e4d32SSunny Srivastava        echo "VPD collection is completed"
11*fa5e4d32SSunny Srivastava        exit 0
12*fa5e4d32SSunny Srivastava    fi
13*fa5e4d32SSunny Srivastava
14*fa5e4d32SSunny Srivastava    retries="$((retries - 1))"
15*fa5e4d32SSunny Srivastava    echo "Waiting for VPD status update. Retries remaining: $retries"
16*fa5e4d32SSunny Srivastavadone
17*fa5e4d32SSunny Srivastavaecho "Exit wait for VPD services to finish with timeout"
18*fa5e4d32SSunny Srivastavaexit 1
19