SCRIPT:
Kod: Markera allt
#!/bin/bash
#global
RRDDataDirectory="/home/look2/rrddata/"
#sensors
KontorTempSensor="28.71AF6E040000"
OutsideTempSensor="28.EADD6E040000"
GastrumTempSensor="28.39C36E040000"
#datafiles
RRDDataFile1="kontor.rrd"
RRDDataFile2="outside_temp.rrd"
RRDDatafile3="gastrum.rrd"
# Get temps form OWFS
KontorTemp=`cat /mnt/1wire/$KontorTempSensor/temperature|sed -e s/" "//g|awk '{$1=$1 + 0.005;printf "%.2f", $1}'`
OutsideTemp=`cat /mnt/1wire/$OutsideTempSensor/temperature|sed -e s/" "//g|awk '{$1=$1 + 0.005;printf "%.2f", $1}'`
GastrumTemp=`cat /mnt/1wire/$GastrumTempSensor/temperature|sed -e s/" "//g|awk '{$1=$1 + 0.005;printf "%.2f", $1}'`
#Update RRD database
rrdtool update $RRDDataDirectory$RRDDataFile1 N:$KontorTemp
rrdtool update $RRDDataDirectory$RRDDataFile2 N:$OutsideTemp
rrdtool update $RRDDataDirectory$RRDDataFile3 N:$GastrumTemp
echo Kontoret: $KontorTemp
echo Ute: $OutsideTemp
echo Gästrum: $GastrumTemp
Kod: Markera allt
look2@fserv:~/bin$ sudo ./get_temp.sh
ERROR: opening '/home/look2/rrddata/': Är en katalog
Kontoret: 21.57
Ute: -2.68
Gästrum: 20.63
som strular till det, komenterar jag bort den, så får jag inget fel...