Manage FAN revolutions on Firm. 4.3.8
From OpenFSG
This is a simple way to manage the FAN revolutions using shell scripts, allowing us tho change the refrigeration mode of the FSG with cron tasks.
Contents |
Requirements
The scripts we are going to install, manage the /etc/master.conf file, which can differ between different firmware versions. These scripts are only tested on firmware 4.3.8. If you install them on other firmware version, use it with care. The "bash_3.2.17-1" package is needed. So, if you don' have it, type "ipkg install bash"
Installation steps
Main controller script
- Create an script in /opt/bin/fan-ctrl with this content:
#!/opt/bin/bash
if [ "$1" != "0" -a "$1" != "1" -a "$1" != "2" ]; then
echo "Use: fan-ctrl <mode>"
echo " where mode can be:"
echo " 0: standard"
echo " 1: max. refrigeration"
echo " 2: hot and silent"
else
MASTER=/etc/master.conf
TEMPFILE=/tmp/master.conf
head -n 16 $MASTER > $TEMPFILE
echo "fand_method=$1" >> $TEMPFILE
total_lines=(`wc -l $MASTER`)
tail_lines=$(($total_lines-17))
tail -n ${tail_lines} $MASTER >> $TEMPFILE
cp $MASTER $MASTER.orig
cp $TEMPFILE $MASTER
killall fand
sleep 2
/etc/init.d/fan start
fi
Hot and silent mode
- Create an script in /opt/bin/fan-hot-silent with this content:
#!/bin/sh /opt/bin/fan-ctrl 2
Standard mode
- Create an script in /opt/bin/fan-standard with this content:
#!/bin/sh /opt/bin/fan-ctrl 0
Max. Refr. mode
- Create an script in /opt/bin/fan-max with this content:
#!/bin/sh /opt/bin/fan-ctrl 1
