summaryrefslogtreecommitdiff
path: root/preventsystemfreeze.sh
diff options
context:
space:
mode:
authorlittleblack111 <jerrylam110209@gmail.com>2023-06-14 20:40:33 +0800
committerlittleblack111 <jerrylam110209@gmail.com>2023-06-14 20:40:33 +0800
commit1ed1813d356b3289e60b2aadfcb997ef4e510efb (patch)
treeb6c46f9c71ba1ace44cd92aaeb2e4931b81d7e6b /preventsystemfreeze.sh
parent635c736432170b42cd8325f52481508fb557c0ac (diff)
update
Diffstat (limited to 'preventsystemfreeze.sh')
-rwxr-xr-xpreventsystemfreeze.sh21
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