blob: a9013b5c10b7f2abdd99e648aa2ca0cd5dbf4c92 [file] [log] [blame]
#!/bin/bash
#
# config: 2 20
# @brief: Get the inventory information.
#
# shellcheck disable=SC1091
. "$DREPORT_INCLUDE"/functions
desc="inventory"
command="busctl call --verbose --no-pager \
xyz.openbmc_project.Inventory.Manager \
/xyz/openbmc_project/inventory \
org.freedesktop.DBus.ObjectManager \
GetManagedObjects"
file_name="inventory.log"
if ! add_cmd_output "$command" "$file_name" "$desc";
then
inventory_dir="/var/lib/phosphor-inventory-manager"
if [ -d "$inventory_dir" ]; then
add_copy_file "$inventory_dir" "$desc"
fi
fi