Skip to content

Instantly share code, notes, and snippets.

@cpietsch
Created November 28, 2021 14:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cpietsch/ba591ea8a1b4cc1eb9c13eb1020b211b to your computer and use it in GitHub Desktop.
Save cpietsch/ba591ea8a1b4cc1eb9c13eb1020b211b to your computer and use it in GitHub Desktop.
shutdown linux when amdgpu reaches junction temperature
#!/bin/sh
maxTemp="+64"
while true; do
currTemp=$(sensors | awk '/junction/ {print $2}' | cut -d"." -f1)
if [[ $currTemp > $maxTemp ]]; then
shutdown now
echo "too high"
fi
echo $currTemp
sleep 5
clear
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment