summaryrefslogtreecommitdiff
path: root/tempmon.sh
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2011-12-31 15:30:27 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2011-12-31 15:30:27 -0500
commit1f9b6ed16159018d1cea762981463e8ee340c062 (patch)
treef7e744a31a01c72bdd4ee8a217e1914485d14b81 /tempmon.sh
parenta9d284811255a1982ff2587467a77a27a82dd74a (diff)
At xylon's suggestion, create tempmon, a temperature monitor, like batterymon.
Diffstat (limited to 'tempmon.sh')
-rw-r--r--tempmon.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/tempmon.sh b/tempmon.sh
new file mode 100644
index 0000000..7fe99d9
--- /dev/null
+++ b/tempmon.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+thresh=$1
+shift
+
+while true; do
+ num=`acpi -t|sed -nr 's/.*, ([0-9.]*) .*/\1/p`
+ num=${num:-0}
+ if (( "$num" > "$thresh" )); then
+ eval "$*"
+ else
+ sleep 1
+ fi
+done