「Fand」(2008/01/30 (水) 12:38:38) の最新版変更点
追加された行は緑色になります。
削除された行は赤色になります。
標準Linuxの/usr/local/sbin/内にある。
*スクリプト
~ # cat /usr/local/sbin/Fand
#!/bin/sh
CONF_FILE=/etc/fan.prof
miconapl -a fan_set_speed full
while :
do
while :
do
sleep 60
TEMP=`miconapl -a temp_get|grep temp=| sed -e "s/.*=//"`
SPD=`miconapl -a fan_get_speed|grep fan_rpm=|sed -e "s/.*=//"`
SSPD=`miconapl -a fan_set_speed|grep fan_speed=|sed -e "s/.*=//"`
if [ -f ${CONF_FILE} ] ; then
L_LIMIT=`grep ${SSPD} ${CONF_FILE}| awk '{print $2}'`
H_LIMIT=`grep ${SSPD} ${CONF_FILE}| awk '{print $3}'`
if [ "${TEMP}" -lt "${L_LIMIT}" ] ; then
DIRECT=DOWN
elif [ "${TEMP}" -gt "${H_LIMIT}" ] ; then
DIRECT=UP
else
DIRECT=NO
fi
if [ "${DIRECT}" = "DOWN" -a "${SSPD}" = "slow" ] ; then
SSPD_NEW=stop
elif [ "${DIRECT}" = "DOWN" -a "${SSPD}" = "fast" -o "${DIRECT}" = "UP" -a "${SSPD}" = "stop" ] ; then
SSPD_NEW=slow
elif [ "${DIRECT}" = "DOWN" -a "${SSPD}" = "full" -o "${DIRECT}" = "UP" -a "${SSPD}" = "slow" ] ; then
SSPD_NEW=fast
elif [ "${DIRECT}" = "UP" -a "${SSPD}" = "fast" ] ; then
SSPD_NEW=full
else
SSPD_NEW=${SSPD}
fi
miconapl -a fan_set_speed ${SSPD_NEW}
fi
done
done
~ #
----
標準Linuxの/usr/local/sbin/内にある。
*スクリプト
~ # cat /usr/local/sbin/Fand
#!/bin/sh
CONF_FILE=/etc/fan.prof
miconapl -a fan_set_speed full
while :
do
while :
do
sleep 60
TEMP=`miconapl -a temp_get|grep temp=| sed -e "s/.*=//"`
SPD=`miconapl -a fan_get_speed|grep fan_rpm=|sed -e "s/.*=//"`
SSPD=`miconapl -a fan_set_speed|grep fan_speed=|sed -e "s/.*=//"`
if [ -f ${CONF_FILE} ] ; then
L_LIMIT=`grep ${SSPD} ${CONF_FILE}| awk '{print $2}'`
H_LIMIT=`grep ${SSPD} ${CONF_FILE}| awk '{print $3}'`
if [ "${TEMP}" -lt "${L_LIMIT}" ] ; then
DIRECT=DOWN
elif [ "${TEMP}" -gt "${H_LIMIT}" ] ; then
DIRECT=UP
else
DIRECT=NO
fi
if [ "${DIRECT}" = "DOWN" -a "${SSPD}" = "slow" ] ; then
SSPD_NEW=stop
elif [ "${DIRECT}" = "DOWN" -a "${SSPD}" = "fast" -o "${DIRECT}" = "UP" -a "${SSPD}" = "stop" ] ; then
SSPD_NEW=slow
elif [ "${DIRECT}" = "DOWN" -a "${SSPD}" = "full" -o "${DIRECT}" = "UP" -a "${SSPD}" = "slow" ] ; then
SSPD_NEW=fast
elif [ "${DIRECT}" = "UP" -a "${SSPD}" = "fast" ] ; then
SSPD_NEW=full
else
SSPD_NEW=${SSPD}
fi
miconapl -a fan_set_speed ${SSPD_NEW}
fi
done
done
~ #
----
表示オプション
横に並べて表示:
変化行の前後のみ表示: