1#!/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) 10led=$(cat /sys/devices/platform/leds/leds/front-id/brightness) 11if [ "$led" == "0" ]; then 12 busctl set-property $SERVICE $object $INTERFACE $PROPERTY b false 13else 14 busctl set-property $SERVICE $object $INTERFACE $PROPERTY b true 15fi 16 17state=$(busctl get-property $SERVICE $object $INTERFACE $PROPERTY \ 18 | awk '{print $NF;}') 19 20if [ "$state" == "false" ]; then 21 target='true' 22else 23 target='false' 24fi 25 26# Set target state 27busctl set-property $SERVICE $object $INTERFACE $PROPERTY b $target 28