blob: 6cab294a5bd7b7143729cdef94e3e932c3f25e3a [file] [log] [blame]
George Keishingebc1e8d2022-11-30 03:00:03 -06001#!/bin/sh
2# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
3# Script to generate valid Sensors dbus path list. #
4# To run this script, copy to BMC home or tmp directory #
5# Power on the system to Runtime and then execute: #
6# sh sensor.sh #
7# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
8
9dbus_obj="xyz.openbmc_project.HwmonTempSensor xyz.openbmc_project.ADCSensor xyz.openbmc_project.VirtualSensor"
10
11for dobj in $dbus_obj
12do
Patrick Williams90dfee32022-12-08 06:52:46 -060013 echo DBUS object:$dobj
14 dbus_cmd_out=`busctl tree $dobj --list | grep /sensors/`
George Keishingebc1e8d2022-11-30 03:00:03 -060015
Patrick Williams90dfee32022-12-08 06:52:46 -060016 for i in $dbus_cmd_out
17 do
18 exist=`busctl introspect $dobj $i | grep yz.openbmc_project.Sensor.Value`
19 if [ ! -z "$exist" ]; then
20 cmd_value=` busctl get-property $dobj $i xyz.openbmc_project.Sensor.Value Value`
21 echo $i Value=${cmd_value##*d}
22 fi
23 done
George Keishingebc1e8d2022-11-30 03:00:03 -060024done