EVERY COMMAND BELOW MUST BE EXECUTED AS ROOT
sed -i 's/supportsystempwarning="yes"/supportsystempwarning="no"/g' /etc.defaults/synoinfo.conf
sed -i 's/supportsystemperature="yes"/supportsystemperature="no"/g' /etc.defaults/synoinfo.conf
#init the led controler
i2cset -y -f 0 0x45 0x00 0x55 # turn off all led
i2cset -y -f 0 0x45 0x01 0x01 # reset the led controller
i2cset -y -f 0 0x45 0x30 0x07 # led on
# set power status for led for always on mode
i2cset -y -f 0 0x45 0x31 0x03 #R
i2cset -y -f 0 0x45 0x32 0x03 #G
i2cset -y -f 0 0x45 0x33 0x03 #B
# set max power fo reach led for flashing mode
i2cset -y -f 0 0x45 0x31 0x72 #R
i2cset -y -f 0 0x45 0x32 0x72 #G
i2cset -y -f 0 0x45 0x33 0x72 #B
#control how long each led takes to go from 0 to 100
i2cset -y -f 0 0x45 0x37 0x44 #R
i2cset -y -f 0 0x45 0x3a 0x55 #G
i2cset -y -f 0 0x45 0x3d 0x66 #B
# control how long each led takes to go from 100 to 0
i2cset -y -f 0 0x45 0x38 0x44 #R
i2cset -y -f 0 0x45 0x3b 0x55 #G
i2cset -y -f 0 0x45 0x3e 0x66 #B
# 0-255,the highter the brighter the led goes
i2cset -y -f 0 0x45 0x34 128 #R
i2cset -y -f 0 0x45 0x35 128 #G
i2cset -y -f 0 0x45 0x36 128 #B
# use when doing all muti color rainbow effect
# dekay between each led on/off??? i guess
# without this on muti color just have 2 color or less sometimes
i2cset -y -f 0 0x45 0x39 0x40
i2cset -y -f 0 0x45 0x3c 0x40
i2cset -y -f 0 0x45 0x3f 0x40
- Flashing violet
i2cset -y -f 0 0x45 0x00 0x55
i2cset -y -f 0 0x45 0x01 0x01
i2cset -y -f 0 0x45 0x30 0x07
i2cset -y -f 0 0x45 0x31 0x72
i2cset -y -f 0 0x45 0x33 0x72
i2cset -y -f 0 0x45 0x37 0x33
i2cset -y -f 0 0x45 0x38 0x33
i2cset -y -f 0 0x45 0x3d 0x33
i2cset -y -f 0 0x45 0x3e 0x33
i2cset -y -f 0 0x45 0x34 128
i2cset -y -f 0 0x45 0x36 128
- red led on
i2cset -y -f 0 0x45 0x00 0x55
i2cset -y -f 0 0x45 0x01 0x01
i2cset -y -f 0 0x45 0x30 0x07
i2cset -y -f 0 0x45 0x31 0x03
i2cset -y -f 0 0x45 0x34 255
- green but orange for big led on green for small
i2cset -y -f 0 0x45 0x00 0x55
i2cset -y -f 0 0x45 0x01 0x01
i2cset -y -f 0 0x45 0x30 0x07
i2cset -y -f 0 0x45 0x32 0x03
i2cset -y -f 0 0x45 0x35 255
- blue led on
i2cset -y -f 0 0x45 0x00 0x55
i2cset -y -f 0 0x45 0x01 0x01
i2cset -y -f 0 0x45 0x30 0x07
i2cset -y -f 0 0x45 0x36 255
- blue flashing
i2cset -y -f 0 0x45 0x00 0x55
i2cset -y -f 0 0x45 0x01 0x01
i2cset -y -f 0 0x45 0x30 0x07
i2cset -y -f 0 0x45 0x33 0x72
i2cset -y -f 0 0x45 0x3d 0x44
i2cset -y -f 0 0x45 0x3e 0x44
i2cset -y -f 0 0x45 0x36 255
- red flashing
i2cset -y -f 0 0x45 0x00 0x55
i2cset -y -f 0 0x45 0x01 0x01
i2cset -y -f 0 0x45 0x30 0x07
i2cset -y -f 0 0x45 0x31 0x72
i2cset -y -f 0 0x45 0x37 0x44
i2cset -y -f 0 0x45 0x38 0x44
i2cset -y -f 0 0x45 0x34 255
- orange flashing
i2cset -y -f 0 0x45 0x00 0x55
i2cset -y -f 0 0x45 0x01 0x01
i2cset -y -f 0 0x45 0x30 0x07
i2cset -y -f 0 0x45 0x32 0x72
i2cset -y -f 0 0x45 0x3a 0x55
i2cset -y -f 0 0x45 0x3b 0x55
i2cset -y -f 0 0x45 0x35 255
- rainbow color
i2cset -y -f 0 0x45 0x00 0x55
i2cset -y -f 0 0x45 0x01 0x01
i2cset -y -f 0 0x45 0x30 0x07
i2cset -y -f 0 0x45 0x31 0x72
i2cset -y -f 0 0x45 0x32 0x72
i2cset -y -f 0 0x45 0x33 0x72
i2cset -y -f 0 0x45 0x37 0x44
i2cset -y -f 0 0x45 0x3a 0x55
i2cset -y -f 0 0x45 0x3d 0x66
i2cset -y -f 0 0x45 0x38 0x44
i2cset -y -f 0 0x45 0x3b 0x55
i2cset -y -f 0 0x45 0x3e 0x66
i2cset -y -f 0 0x45 0x39 0x40
i2cset -y -f 0 0x45 0x3c 0x40
i2cset -y -f 0 0x45 0x3f 0x40
i2cset -y -f 0 0x45 0x34 255
i2cset -y -f 0 0x45 0x35 255
i2cset -y -f 0 0x45 0x36 255
/usr/sbin/ntpdate -u time.google.com
Disable high capacity services, enable hibernation on hard disk and LEDs - green blinks when hibernate, blue is always on when woken, and red blinks when network is abnormal
mount -o bind /dev/null /var/log/scemd.log || true
systemctl stop pkg-scsit-monitor.service
mkdir -p /tmp/scripts
cat > /tmp/scripts/ledfan.sh <<EOF
#!/bin/sh
if [ ! -d /sys/class/gpio/gpio450 ] ; then
echo 450 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio450/direction
i2cset -y -f 0 0x45 0x00 0x55
i2cset -y -f 0 0x45 0x01 0x01
i2cset -y -f 0 0x45 0x30 0x07
while true
do
#Detect network connection
ping -W 1 -c 1 Lenovo > /dev/null 2>&1
if [ $? -eq 0 ];
then
i2cset -y -f 0 0x45 0x34 0x00
else
i2cset -y -f 0 0x45 0x31 0x73
i2cset -y -f 0 0x45 0x34 255
fi
sata="\$(hdparm -C /dev/sda |grep 'drive'|awk '{print \$4}')"
if [ \$sata = standby ];then
i2cset -y -f 0 0x45 0x36 0
i2cset -y -f 0 0x45 0x32 0x73 #呼吸
i2cset -y -f 0 0x45 0x35 200
echo 0 > /sys/class/gpio/gpio450/value
fi
if [ \$sata = active/idle ];then
sata_temp="\$(smartctl -a /dev/hda -d ata | sed -n '/Temperature_Celsius/p' | awk '{print \$10}')"
i2cset -y -f 0 0x45 0x35 0
i2cset -y -f 0 0x45 0x33 0x03 #常亮
i2cset -y -f 0 0x45 0x36 150 #B
echo 1 > /sys/class/gpio/gpio450/value
fi
sleep 30
done
EOF
bash /tmp/scripts/ledfan.sh