blob: f0906b9bdcad9655b26ba0e7fe49579cadfdceb0 [file] [log] [blame]
#!/bin/bash
#
# config: 2 20
# @brief: Get the fan monitor dump
#
. $DREPORT_INCLUDE/functions
if [ ! -e "/usr/bin/phosphor-fan-monitor" ]; then
exit 0
fi
file_name="/tmp/fan_monitor_dump.json"
rm -f $file_name
killall -s SIGUSR1 phosphor-fan-monitor
seconds=0
while [ ! -e "$file_name" ]; do
seconds=$(( seconds + 1 ))
if [ $seconds -eq 5 ]; then
echo "Timed out waiting for fan monitor dump"
exit 0
fi
sleep 1
done
desc="fan monitor dump"
add_copy_file "$file_name" "$desc"
rm -rf /tmp/fan_monitor_dump.json