blob: f0906b9bdcad9655b26ba0e7fe49579cadfdceb0 [file] [log] [blame]
Matt Spinler2d38ad52022-09-08 10:42:42 -05001#!/bin/bash
2#
3# config: 2 20
4# @brief: Get the fan monitor dump
5#
6
7. $DREPORT_INCLUDE/functions
8
9if [ ! -e "/usr/bin/phosphor-fan-monitor" ]; then
10 exit 0
11fi
12
13file_name="/tmp/fan_monitor_dump.json"
14
15rm -f $file_name
16killall -s SIGUSR1 phosphor-fan-monitor
17
18seconds=0
19while [ ! -e "$file_name" ]; do
20 seconds=$(( seconds + 1 ))
21 if [ $seconds -eq 5 ]; then
22 echo "Timed out waiting for fan monitor dump"
23 exit 0
24 fi
25 sleep 1
26done
27
28desc="fan monitor dump"
29add_copy_file "$file_name" "$desc"
30
31rm -rf /tmp/fan_monitor_dump.json