#!/bin/sh rrdtool graph "$graph.tmp" \ \ --imgformat PNG \ \ --width "$width" \ --height "$height" \ \ --start end-1d \ --end now \ \ --title 'Two days' \ --vertical-label '°C' \ \ --units-exponent 0 \ --units-length "$units_length" \ \ --slope-mode \ --interlaced \ --alt-y-grid \ \ "DEF:temp=$rrd:temp:AVERAGE" \ "DEF:temp_cf_min=$rrd:temp:MIN" \ "DEF:temp_cf_max=$rrd:temp:MAX" \ \ "DEF:temp_y=$rrd:temp:AVERAGE:start=end-1d:end=now-1d" \ "DEF:temp_y_cf_min=$rrd:temp:MIN:start=end-1d:end=now-1d" \ "DEF:temp_y_cf_max=$rrd:temp:MAX:start=end-1d:end=now-1d" \ \ "SHIFT:temp_y:$shift_1day" \ \ 'VDEF:temp_min=temp_cf_min,MINIMUM' \ 'VDEF:temp_max=temp_cf_max,MAXIMUM' \ 'VDEF:temp_avg=temp,AVERAGE' \ 'VDEF:temp_last=temp,LAST' \ \ 'VDEF:temp_min_y=temp_y_cf_min,MINIMUM' \ 'VDEF:temp_max_y=temp_y_cf_max,MAXIMUM' \ 'VDEF:temp_avg_y=temp_y,AVERAGE' \ \ 'COMMENT:\s' \ 'COMMENT:\s' \ 'COMMENT:\s' \ 'COMMENT: Min Max Avg Last\n' \ 'COMMENT:\s' \ \ "LINE2:temp_y#$yesterday:Yesterday " \ 'GPRINT:temp_min_y:%6.1lf' \ 'GPRINT:temp_max_y:%6.1lf' \ 'GPRINT:temp_avg_y:%6.1lf\n' \ \ "LINE2:temp#$today:Today " \ 'GPRINT:temp_min:%6.1lf' \ 'GPRINT:temp_max:%6.1lf' \ 'GPRINT:temp_avg:%6.1lf' \ 'GPRINT:temp_last:%6.1lf\n' \ \ "COMMENT: `date '+%Y-%m-%d %H\:%M\:%S GMT%z/%Z'`" \ \ > /dev/null && \ \ mv "$graph.tmp" "$graph" || \ exit 1