sudo -s
apt update && apt install thinkfan
echo "options thinkpad_acpi fan_control=1" > /etc/modprobe.d/thinkfan.conf
modprobe -rv thinkpad_acpi
modprobe -v thinkpad_acpi
echo "hwmon /sys/devices/platform/coretemp.0/hwmon/hwmon4/temp1_input" >> /etc/thinkfan.conf
echo "(0,   0,  55)" >> /etc/thinkfan.conf
echo "(1,   48, 60)" >> /etc/thinkfan.conf
echo "(2,   50, 61)" >> /etc/thinkfan.conf
echo "(3,   52, 63)" >> /etc/thinkfan.conf
echo "(4,   56, 65)" >> /etc/thinkfan.conf
echo "(5,   59, 66)" >> /etc/thinkfan.conf
echo "(7,   63, 32767)" >> /etc/thinkfan.conf
echo "START=yes" >> /etc/default/thinkfan
systemctl enable thinkfan.service
systemctl start thinkfan.service