#!/bin/sh
#
# $Log: acpi.in,v $
# Revision 1.1  2004/05/06 21:39:54  jimmyo
# Added plugin acpi, contributed by Alexandre Dupouy.
#
#
#%# family=contrib
#%# capabilities=autoconf

if [ "$1" = "autoconf" ]; then
	acpi_available 2>/dev/null >/dev/null
        if [ "$?" = "0" ]; then
		echo yes
		exit 0
	else
		echo no
		exit 1
	fi
fi

if [ "$1" = "config" ]; then

        echo 'graph_title CPU temperature'
        echo 'graph_args --base 1000 -l 0'
        echo 'graph_vlabel temp in C'
        echo cpu.label cpu
        exit 0
fi

t=$(echo "`acpi -t -B`" | awk '{print $4}' | tr '.' ' ' | cut -f 1 -d ' ')
echo "cpu.value $t"
