~ubuntu-branches/debian/jessie/digitemp/jessie

« back to all changes in this revision

Viewing changes to rrdb/log_temp

  • Committer: Bazaar Package Importer
  • Author(s): Jesus Roncero
  • Date: 2004-09-01 01:34:37 UTC
  • Revision ID: james.westby@ubuntu.com-20040901013437-eicsrrd40dr371u0
Tags: upstream-3.3.2
ImportĀ upstreamĀ versionĀ 3.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
 
 
3
# DigiTemp RRD logging script
 
4
# Copyright 1997-2002 by Brian C. Lane <bcl@brianlane.com> www.brianlane.com
 
5
# All Rights Reserved
 
6
#
 
7
# This program is free software; you can redistribute it and/or modify it
 
8
# under the terms of the GNU General Public License as published by the Free
 
9
# Software Foundation; either version 2 of the License, or (at your option)
 
10
# any later version.
 
11
#
 
12
# This program is distributed in the hope that it will be useful, but WITHOUT
 
13
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 
14
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 
15
# more details.
 
16
#
 
17
# You should have received a copy of the GNU General Public License along
 
18
# with this program; if not, write to the Free Software Foundation, Inc.,
 
19
# 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
 
20
#
 
21
 
 
22
# Call this from crontab every 5 minutes. Make sure the .digitemprc is in
 
23
# your root directory or specify the configuration file using -c filename
 
24
# on the digitemp command line in the reading variable below.
 
25
 
 
26
# Get the current temperatures, digitemp has been previously initalized with
 
27
# digitemp -i -s /dev/ttyS0 -o2 -a
 
28
 
 
29
# Run it in quiet mode, output is 0\tsensor#1\tsensor#2\tsensor#3
 
30
reading=`/usr/local/bin/digitemp -a -q`
 
31
 
 
32
# Diagnostic output
 
33
room=`echo $reading | gawk '{print $2}'`
 
34
attic=`echo $reading | gawk '{print $3}'`
 
35
drink=`echo $reading | gawk '{print $4}'`
 
36
 
 
37
# Update the database
 
38
/usr/local/rrdtool/bin/rrdtool update /root/rrdb/digitemp.rrd N:$room:$drink:$attic