Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] auto-shutdown at certain temp application?



On Wed, 14 Jun 2006 15:49:27 +0900, Scott VanDusen
<Scott_VanDusen@example.com> wrote:

> Maybe a polling program that does
> cat /proc/acpi/thermal_zone/THRM/temperature and if it gets to a
> certain degree runs shutdown -h now? Has anyone heard of a program
> that does something like this?

Isn't that simple enough to write onesself? A small script using awk
in a cron job should take care of that.

Something like:

#!/bin/bash

TEMP=`cat /proc/acpi/thermal_zone/THRM/temperature | awk '{print $2}'`
CUTOFF="75"
if [ "$TEMP" -ge "$CUTOFF" ]; then
  echo "$CUTOFF C. reached - goodbye cruel world" | /bin/mail foo@example.com
  sleep 5
  /sbin/shutdown -h now
fi

Or if the one-minute resolution of cron timing isn't enough then wrap
it into a script that loops every so many seconds.

-- 
G. Stewart - godwin.stewart@example.com

Why is it that when you transport something by car it's called
shipment, but when you transport it by ship it's called cargo?

Attachment: pgpX2YM3RIEsi.pgp
Description: PGP signature


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links