diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2011-12-31 15:30:27 -0500 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2011-12-31 15:30:27 -0500 |
commit | 1f9b6ed16159018d1cea762981463e8ee340c062 (patch) | |
tree | f7e744a31a01c72bdd4ee8a217e1914485d14b81 | |
parent | a9d284811255a1982ff2587467a77a27a82dd74a (diff) |
At xylon's suggestion, create tempmon, a temperature monitor, like batterymon.
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 1 | ||||
-rw-r--r-- | tempmon.sh | 14 |
3 files changed, 16 insertions, 0 deletions
@@ -15,6 +15,7 @@ offlineimap-runner ord roll sysfiles +tempmon urldecode v-www-browser v-editor @@ -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 |