Last active
August 4, 2026 07:42
-
-
Save milanboers/b37c76943df474ffcc24f8b3341ff079 to your computer and use it in GitHub Desktop.
sensors with it87 kernel module (id 0x8628, Gigabyte B550M DS3H rev 1.5)
This file contains hidden or 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 | |
| # Ensure script is run with sudo | |
| if [ "$EUID" -ne 0 ]; then | |
| echo "Please run with sudo: sudo ./readsensors.sh" | |
| exit 1 | |
| fi | |
| # Cleanup function: unloads the driver when the script exits or receives Ctrl+C | |
| cleanup() { | |
| echo -e "\n--> Unloading it87 kernel module..." | |
| modprobe -r it87 | |
| echo "Done! Kernel module unloaded." | |
| exit 0 | |
| } | |
| # Catch interrupt (Ctrl+C) and exit signals to ensure cleanup runs | |
| trap cleanup SIGINT SIGTERM EXIT | |
| echo "--> Loading temporary it87 kernel module..." | |
| modprobe it87 ignore_resource_conflict=1 force_id=0x8628 | |
| echo "Starting live monitor... Press Ctrl+C to stop." | |
| sleep 1 | |
| # Runs 'sensors' every 1 second continuously | |
| watch -n 1 sensors |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment