sensor_temperature revision 1.4
1#!/bin/sh - 2# 3# $NetBSD: sensor_temperature,v 1.4 2012/04/10 13:58:52 jruoho Exp $ 4# 5# Generic script for temperature sensors. 6# 7# Arguments passed by powerd(8): 8# 9# script_path device event sensor 10 11case "${2}" in 12normal) 13 logger -p warning "${0}: ($1) normal state entered [${3}]" >&1 14 exit 0 15 ;; 16critical) 17 logger -p warning "${0}: ($1) critical state entered [${3}]" >&1 18 /sbin/shutdown -p now "${0}: CRITICAL TEMPERATURE! SHUTTING DOWN." 19 exit 0 20 ;; 21critical-under) 22 logger -p warning "${0}: ($1) dropped below critical limit [${3}]" >&1 23 exit 0 24 ;; 25critical-over) 26 logger -p warning "${0}: ($1) critical limit exceeded [${3}]" >&1 27 /sbin/shutdown -p now "${0}: CRITICAL TEMPERATURE! SHUTTING DOWN." 28 exit 0 29 ;; 30warning-under) 31 logger -p warning "${0}: ($1) dropped below warning limit [${3}]" >&1 32 exit 0 33 ;; 34warning-over) 35 logger -p warning "${0}: ($1) warning limit exceeded [${3}]" >&1 36 exit 0 37 ;; 38*) 39 logger -p warning "${0}: unsupported event ${2} on device ${1}" >&1 40 exit 1 41 ;; 42esac 43