Skip to content

Instantly share code, notes, and snippets.

@nyx-rattapoom
Created December 22, 2021 23:40
Show Gist options
  • Save nyx-rattapoom/00107205db9c7f88a5e34bda1674acb3 to your computer and use it in GitHub Desktop.
Save nyx-rattapoom/00107205db9c7f88a5e34bda1674acb3 to your computer and use it in GitHub Desktop.
fan control
#!/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