diff options
| author | littleblack111 <jerrylam110209@gmail.com> | 2023-06-14 20:40:33 +0800 |
|---|---|---|
| committer | littleblack111 <jerrylam110209@gmail.com> | 2023-06-14 20:40:33 +0800 |
| commit | 1ed1813d356b3289e60b2aadfcb997ef4e510efb (patch) | |
| tree | b6c46f9c71ba1ace44cd92aaeb2e4931b81d7e6b /preventsystemfreeze.sh | |
| parent | 635c736432170b42cd8325f52481508fb557c0ac (diff) | |
update
Diffstat (limited to 'preventsystemfreeze.sh')
| -rwxr-xr-x | preventsystemfreeze.sh | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/preventsystemfreeze.sh b/preventsystemfreeze.sh deleted file mode 100755 index d674356..0000000 --- a/preventsystemfreeze.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -# Maximum CPU temperature in degrees Celsius -MAX_TEMP=180 - -# Maximum time in seconds that the system can be frozen -MAX_FROZEN_TIME=300 - -# Check the CPU temperature -TEMP=$(sensors | grep 'Core 0:' | awk '{print $3}' | cut -c2-3) -if [ $TEMP -ge $MAX_TEMP ]; then - echo "CPU temperature is too high. Rebooting..." - /sbin/reboot -fi - -# Check if the system is frozen -LAST_LOAD=$(uptime | awk '{print $NF}') -if [ $LAST_LOAD -gt $MAX_FROZEN_TIME ]; then - echo "System is frozen. Rebooting..." - /sbin/reboot -fi |
