diff options
author | Thang Q. Nguyen <thang@os.amperecomputing.com> | 2021-11-04 11:30:27 +0300 |
---|---|---|
committer | Thang Q. Nguyen <thang@os.amperecomputing.com> | 2021-11-04 16:10:58 +0300 |
commit | dde1fede1f832f029742a1d27290cfe252ab1bc5 (patch) | |
tree | d8e4bbb3ee309dbcc4324a98682bbf444bbe8ca2 /meta-ampere/meta-jade/recipes-phosphor/gpio/id-button | |
parent | 5a5f33c729e6b5869362172b63595422eb84a418 (diff) | |
download | openbmc-dde1fede1f832f029742a1d27290cfe252ab1bc5.tar.xz |
meta-ampere: fix shellcheck issues
Fix all issues from the shellcheck checked on bash shells under
meta-ampere.
Tested: Verify the following features:
1. Power control (on,off, cycle, graceful shutdown, hard reset).
2. UART switching.
3. UEFI firmware update.
Signed-off-by: Thang Q. Nguyen <thang@os.amperecomputing.com>
Change-Id: Idabf839b7521ecadb642230cc8bb3472c787002e
Diffstat (limited to 'meta-ampere/meta-jade/recipes-phosphor/gpio/id-button')
-rwxr-xr-x | meta-ampere/meta-jade/recipes-phosphor/gpio/id-button/toggle_identify_led.sh | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/meta-ampere/meta-jade/recipes-phosphor/gpio/id-button/toggle_identify_led.sh b/meta-ampere/meta-jade/recipes-phosphor/gpio/id-button/toggle_identify_led.sh index d62c84ae1..06b2d55f1 100755 --- a/meta-ampere/meta-jade/recipes-phosphor/gpio/id-button/toggle_identify_led.sh +++ b/meta-ampere/meta-jade/recipes-phosphor/gpio/id-button/toggle_identify_led.sh @@ -22,24 +22,24 @@ PROPERTY="Asserted" # Get enclosure_identify state identify_object=$(busctl tree $SERVICE --list | grep -m 1 identify) -identify_state=$(busctl get-property $SERVICE $identify_object $INTERFACE $PROPERTY \ - | awk '{print $NF;}') +identify_state=$(busctl get-property $SERVICE "$identify_object" $INTERFACE $PROPERTY \ + | awk '{print $NF;}') # Get enclosure_identify_blink state identify_blink_object=$(busctl tree $SERVICE --list | grep identify_blink) -identify_blink_state=$(busctl get-property $SERVICE $identify_blink_object $INTERFACE $PROPERTY \ - | awk '{print $NF;}') +identify_blink_state=$(busctl get-property $SERVICE "$identify_blink_object" $INTERFACE $PROPERTY \ + | awk '{print $NF;}') # Set state -if [[ "$identify_state" == "false" && "$identify_blink_state" == "false" ]]; then +if [ "$identify_state" = "false" ] && [ "$identify_blink_state" = "false" ]; then # Turn on the UID LED - busctl set-property $SERVICE $identify_object $INTERFACE $PROPERTY b true -elif [[ "$identify_state" == "false" && "$identify_blink_state" == "true" ]]; then + busctl set-property $SERVICE "$identify_object" $INTERFACE $PROPERTY b true +elif [ "$identify_state" = "false" ] && [ "$identify_blink_state" = "true" ]; then # Turn off the UID LED when LED is blinking state - busctl set-property $SERVICE $identify_blink_object $INTERFACE $PROPERTY b false -elif [[ "$identify_state" == "true" && "$identify_blink_state" == "false" ]]; then + busctl set-property $SERVICE "$identify_blink_object" $INTERFACE $PROPERTY b false +elif [ "$identify_state" = "true" ] && [ "$identify_blink_state" = "false" ]; then # Turn off the UID LED - busctl set-property $SERVICE $identify_object $INTERFACE $PROPERTY b false + busctl set-property $SERVICE "$identify_object" $INTERFACE $PROPERTY b false else echo "Invalid case! When identify_blink_state is true, the identify_state will set to false" fi |