blob: 58aa47f8e8f13327bb92fc968e03e115667cd0db [file] [log] [blame]
Thang Q. Nguyenbd7d6332021-12-06 10:18:21 +00001#!/bin/bash
2#
3# Toggle the state of identify LED Group
4
5socket=$1
6isOn=$2
7
8# Create /tmp/fault* file
9if [ "$isOn" == "on" ]; then
10 touch /tmp/fault"$socket"
11else
12 rm /tmp/fault"$socket"
13fi
14
15# Set Fault Led state
16if [[ -f /tmp/fault0 ]] || [[ -f /tmp/fault1 ]]; then
17 target='true'
18else
19 target='false'
20fi
21
22SERVICE="xyz.openbmc_project.LED.GroupManager"
23INTERFACE="xyz.openbmc_project.Led.Group"
24PROPERTY="Asserted"
25
26# Get current state
27object=$(busctl tree $SERVICE --list | grep system_fault)
28
29# Set target state
30busctl set-property $SERVICE "$object" $INTERFACE $PROPERTY b $target