summaryrefslogtreecommitdiff
path: root/tempmon.sh
diff options
context:
space:
mode:
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