diff options
author | jmbills <jason.m.bills@intel.com> | 2022-01-18 21:55:05 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-18 21:55:05 +0300 |
commit | 7cf0c1cd0ce835d1833509b7b911e8a97380278b (patch) | |
tree | 0b45c3beaa9874facc4ed1a2395a31e42be0135d /meta-ampere/meta-jade/recipes-phosphor/gpio/psu-hotswap-reset/ampere_psu_reset_hotswap.sh | |
parent | 4dac5fcd49b5e2de1074f1363775ec0f19041072 (diff) | |
parent | 1fc0d70f658da30091bcd49f9bf29aecd6b99ba7 (diff) | |
download | openbmc-7cf0c1cd0ce835d1833509b7b911e8a97380278b.tar.xz |
Merge pull request #76 from Intel-BMC/update1-0.86
Update
Diffstat (limited to 'meta-ampere/meta-jade/recipes-phosphor/gpio/psu-hotswap-reset/ampere_psu_reset_hotswap.sh')
-rwxr-xr-x[-rw-r--r--] | meta-ampere/meta-jade/recipes-phosphor/gpio/psu-hotswap-reset/ampere_psu_reset_hotswap.sh | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/meta-ampere/meta-jade/recipes-phosphor/gpio/psu-hotswap-reset/ampere_psu_reset_hotswap.sh b/meta-ampere/meta-jade/recipes-phosphor/gpio/psu-hotswap-reset/ampere_psu_reset_hotswap.sh index 65bff9dc1..37a3ce301 100644..100755 --- a/meta-ampere/meta-jade/recipes-phosphor/gpio/psu-hotswap-reset/ampere_psu_reset_hotswap.sh +++ b/meta-ampere/meta-jade/recipes-phosphor/gpio/psu-hotswap-reset/ampere_psu_reset_hotswap.sh @@ -29,10 +29,10 @@ STATUS_MFR_SPECIFIC=0x80 # $1 will be the name of the psu PSU=$1 -if [[ $PSU == 1 ]]; then +if [ "$PSU" = 1 ]; then HSC_PMBUS_NUM=$HSC1_PMBUS_NUM HSC_SLAVE_ADDR=$HSC1_SLAVE_ADDR -elif [[ $PSU == 2 ]]; then +elif [ "$PSU" = 2 ]; then HSC_PMBUS_NUM=$HSC2_PMBUS_NUM HSC_SLAVE_ADDR=$HSC2_SLAVE_ADDR else @@ -43,22 +43,20 @@ fi # Check HOST state chassisstate=$(obmcutil chassisstate | awk -F. '{print $NF}') -if [[ "$chassisstate" == 'Off' ]]; then +if [ "$chassisstate" = 'Off' ]; then echo "HOST is being OFF, so can't access the i2c $HSC_PMBUS_NUM. Please Turn ON HOST !" exit 1 fi # Check FET health problems -data=$(i2cget -f -y $HSC_PMBUS_NUM $HSC_SLAVE_ADDR $STATUS_MFR_SPECIFIC) - -if [[ $? -ne 0 ]]; then +if ! data=$(i2cget -f -y $HSC_PMBUS_NUM $HSC_SLAVE_ADDR $STATUS_MFR_SPECIFIC); then echo "ERROR: Can't access the i2c. Please check /dev/i2c-$HSC_PMBUS_NUM" exit 1 fi psu_sts=$(((data & 0x80) != 0)) -if [[ $psu_sts == 1 ]]; then +if [ $psu_sts = 1 ]; then echo "PSU $PSU: FET health problems have been detected" echo "Reset Hot swap output on PSU $PSU" # Disable Hot swap output @@ -71,4 +69,4 @@ if [[ $psu_sts == 1 ]]; then else echo "PSU $PSU: FET health problems have not been detected" -fi
\ No newline at end of file +fi |