George Keishing | ebc1e8d | 2022-11-30 03:00:03 -0600 | [diff] [blame] | 1 | #!/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 | |
| 9 | dbus_obj="xyz.openbmc_project.HwmonTempSensor xyz.openbmc_project.ADCSensor xyz.openbmc_project.VirtualSensor" |
| 10 | |
| 11 | for dobj in $dbus_obj |
| 12 | do |
Patrick Williams | 90dfee3 | 2022-12-08 06:52:46 -0600 | [diff] [blame] | 13 | echo DBUS object:$dobj |
| 14 | dbus_cmd_out=`busctl tree $dobj --list | grep /sensors/` |
George Keishing | ebc1e8d | 2022-11-30 03:00:03 -0600 | [diff] [blame] | 15 | |
Patrick Williams | 90dfee3 | 2022-12-08 06:52:46 -0600 | [diff] [blame] | 16 | 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 Keishing | ebc1e8d | 2022-11-30 03:00:03 -0600 | [diff] [blame] | 24 | done |