#!/bin/sh

FAN_CTRL_PID=/var/run/fan_controller.pid

# To prevent S.M.A.R.T commands to spinup a disk, shutdown the fan 
# controller.
if [ -f "${FAN_CTRL_PID}" ]; then
  fan_ctrl_pid=`/bin/cat ${FAN_CTRL_PID}`
else
  fan_ctrl_pid=`/usr/bin/pgrep fan_controller`
fi

[ -n "${fan_ctrl_pid}" ]    || exit 1
kill -USR1 ${fan_ctrl_pid}  || exit 1

exit 0

