С1 не понимает указания точного числа оборотов
Functions:
h high speed(7000rpm)
l low speed(2700rpm)
s stop fan
g get fan status
the below option only support in a1 and b1 hardware board
w rpm, set fan speed(rpm range:0 for stop, 2700~7000)
Только h l s g доступно !
Funscript Не будет работать корректно
Я делал через крон
fan-cron.sh который кладем в /ffp/start
Код:
#!/bin/sh
# copy script to rootfs to avoid preventing the disks from spinning down
cp /ffp/bin/fan_ctrl_cron.sh /usr/bin/
# add the fan control script to the current cron list at 1 minute intervals
echo "$(crontab -l;echo '*/1 * * * * /usr/bin/fan_ctrl_cron.sh')"|crontab -
fan_ctrl_cron.sh кладем в /ffp/bin
Код:
#!/bin/sh
#
# Script to control the fan speed on a D-Link DNS-323
#
# Note: This script is intended to be ran from the cron
#
# Author: Bruno Gravato
#
# version: 1.0
#
PATH=/usr/bin:/bin:/usr/sbin:/sbin
# kill original fancontrol daemon
PID=`pidof fancontrol`
if [ "$PID" != "" ]
then
kill -9 $PID
fi
# variables (temperatures are in Fahrenheit)
#
# fan will stop when temperature reaches this value
TEMP_STOP=99
# fan will spin at low speed when temperature reaches this value
TEMP_LOW=105
# fan will spin at high speed when temperature reaches this value
TEMP_HIGH=113
# this is fan's rpm (rotations per minute) reference point to determine
# wether the fan is rotating at high or low speed
RPM_REF=4000
# get current temperature and fan speed
TEMP=$(temperature g 0)
TEMP=${TEMP##*=}
SPEED=$(fanspeed g)
# check fan speed
if [ $SPEED -lt 1 ]
# fan is stopped
then
if [ $TEMP -ge $TEMP_HIGH ]
then
# set high speed
fanspeed h
elif [ $TEMP -ge $TEMP_LOW ]
then
# set low speed
fanspeed l
fi
else
# fan is spinning
if [ $TEMP -le $TEMP_STOP ]
then
# stop the fan
fanspeed s
elif [ $SPEED -lt $RPM_REF ]
# fan at low speed
then
if [ $TEMP -ge $TEMP_HIGH ]
then
# set high speed
fanspeed h
fi
else
# fan at high speed
if [ $TEMP -le $TEMP_LOW ]
then
# set low speed
fanspeed l
fi
fi
fi