diff options
author | Timothy Pearson <tpearson@raptorengineering.com> | 2019-04-20 11:08:01 +0000 |
---|---|---|
committer | Timothy Pearson <tpearson@raptorengineering.com> | 2019-04-27 08:06:40 +0000 |
commit | fc010d48f3a9686e4898114bfa870fde16eab3eb (patch) | |
tree | 1367549a24b522120ea1302b1b128cba52fff41b /meta-rcs/meta-talos/recipes-phosphor/gpio/id-button/toggle_identify_led.sh | |
parent | 4080949e757977768c1403269afc61d4495e02b5 (diff) | |
download | blackbird-openbmc-fc010d48f3a9686e4898114bfa870fde16eab3eb.tar.gz blackbird-openbmc-fc010d48f3a9686e4898114bfa870fde16eab3eb.zip |
Add flash, GPIO, and state recipies from Romulus
Diffstat (limited to 'meta-rcs/meta-talos/recipes-phosphor/gpio/id-button/toggle_identify_led.sh')
-rwxr-xr-x | meta-rcs/meta-talos/recipes-phosphor/gpio/id-button/toggle_identify_led.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/meta-rcs/meta-talos/recipes-phosphor/gpio/id-button/toggle_identify_led.sh b/meta-rcs/meta-talos/recipes-phosphor/gpio/id-button/toggle_identify_led.sh new file mode 100755 index 000000000..eec96d3f1 --- /dev/null +++ b/meta-rcs/meta-talos/recipes-phosphor/gpio/id-button/toggle_identify_led.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# Toggle the state of identify LED Group + +SERVICE="xyz.openbmc_project.LED.GroupManager" +INTERFACE="xyz.openbmc_project.Led.Group" +PROPERTY="Asserted" + +# Get current state +object=$(busctl tree $SERVICE --list | grep identify) +state=$(busctl get-property $SERVICE $object $INTERFACE $PROPERTY \ + | awk '{print $NF;}') + +if [ "$state" == "false" ]; then + target='true' +else + target='false' +fi + +# Set target state +busctl set-property $SERVICE $object $INTERFACE $PROPERTY b $target |