Created
December 22, 2021 23:40
-
-
Save nyx-rattapoom/00107205db9c7f88a5e34bda1674acb3 to your computer and use it in GitHub Desktop.
fan control
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
/usr/local/bin/gpio mode 4 out | |
# temperature=$(< /sys/class/thermal/thermal_zone0/temp) | |
temperature=$(< /etc/armbianmonitor/datasources/soctemp) | |
echo "temperature=$temperature" | |
if [ $temperature -gt 50000 ] | |
then | |
/usr/local/bin/gpio write 4 1 | |
echo "turn on" | |
else | |
/usr/local/bin/gpio write 4 0 | |
echo "turn off" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment