blob: eec96d3f193f6d4a880a124c65913d88ccbf4670 [file] [log] [blame]
Lei YU10655592018-04-11 11:10:31 +08001#!/bin/sh
2# Toggle the state of identify LED Group
3
4SERVICE="xyz.openbmc_project.LED.GroupManager"
5INTERFACE="xyz.openbmc_project.Led.Group"
6PROPERTY="Asserted"
7
8# Get current state
9object=$(busctl tree $SERVICE --list | grep identify)
10state=$(busctl get-property $SERVICE $object $INTERFACE $PROPERTY \
11 | awk '{print $NF;}')
12
13if [ "$state" == "false" ]; then
14 target='true'
15else
16 target='false'
17fi
18
19# Set target state
20busctl set-property $SERVICE $object $INTERFACE $PROPERTY b $target