summaryrefslogtreecommitdiff
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
parenta9d284811255a1982ff2587467a77a27a82dd74a (diff)
At xylon's suggestion, create tempmon, a temperature monitor, like batterymon.
-rw-r--r--.gitignore1
-rw-r--r--Makefile1
-rw-r--r--tempmon.sh14
3 files changed, 16 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 002ffda..7bc8d7c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,6 +15,7 @@ offlineimap-runner
ord
roll
sysfiles
+tempmon
urldecode
v-www-browser
v-editor
diff --git a/Makefile b/Makefile
index 7365cbc..c64a96d 100644
--- a/Makefile
+++ b/Makefile
@@ -21,6 +21,7 @@ BINFILES = \
ord \
roll \
sysfiles \
+ tempmon \
urldecode \
v-www-browser \
v-editor \
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