The following changes since commit 7d418adee720981954056c4ff6db053c6c1935c8: update readme (2016-05-02 17:11:51 -0700) are available in the git repository at: . for you to fetch changes up to b62b8b7f15e758a7802a0cfd5ef44846daf63d39: Fix spelling to Celsius (2016-05-08 17:31:54 -0500) ---------------------------------------------------------------- David Dyer-Bennet (4): Remove --rigid from graphing Send error text to stderr Fix broken echo, remove function Fix spelling to Celsius rrd-graph.sh | 14 +++++++------- rrd.sh | 15 +++++++++------ temps-rrd-format.sh | 2 +- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/rrd-graph.sh b/rrd-graph.sh index c0c0629..88ed545 100755 --- a/rrd-graph.sh +++ b/rrd-graph.sh @@ -10,10 +10,10 @@ ##### if [ -z $1 ]; then - echo "Error: you need to give an input filename as an argument. Ex:" - echo " $0 temps-Xmin.rrd" - echo - echo "Exiting..." + errprint "Error: you need to give an input filename as an argument. Ex:" 1>&@ + errprint " $0 temps-Xmin.rrd" 1>&2 + errprint 1>&2 + errprint "Exiting..." 1>&2 exit 1 fi @@ -73,15 +73,15 @@ write_graph_to_disk () --font DEFAULT:7: \ --title "${title}" \ --watermark "`date`" \ - --vertical-label "Celcius" \ - --right-axis-label "Celcius" \ + --vertical-label "Celsius" \ + --right-axis-label "Celsius" \ ${guidrule} \ ${defsandlines} \ --right-axis 1:0 \ --alt-autoscale \ --lower-limit ${MINGRAPHTEMP} \ --upper-limit ${MAXGRAPHTEMP} \ - --rigid > /dev/null + > /dev/null # "HRULE:${SAFETEMPLINE}#FF0000:Max safe temp - ${SAFETEMPLINE}" # "HRULE:${SAFETEMPLINE}#FF0000:Max-${SAFETEMPLINE}" } diff --git a/rrd.sh b/rrd.sh index 17bd6b2..c39afcf 100755 --- a/rrd.sh +++ b/rrd.sh @@ -14,18 +14,21 @@ # # error on unset variables # set -o nounset - +function errprint () { + echo "$@" 1>&2 +} if [ "$(id -u)" != "0" ]; then - echo "Error: this script needs to be run as root (for smartctl). Try 'sudo $0 $1'" + errprint "Error: this script needs to be run as root (for smartctl). +Try 'sudo $0 $1'" exit 1 fi if [ -z $1 ]; then - echo "Error: you need to give an output filename as an argument. Ex:" - echo " $0 outputdata.rrd" - echo - echo "Exiting..." + errprint "Error: you need to give an output filename as an argument. Ex:" + errprint " $0 outputdata.rrd" + errprint + errprint "Exiting..." exit 1 fi diff --git a/temps-rrd-format.sh b/temps-rrd-format.sh index 6ad5cd8..b50e2ca 100755 --- a/temps-rrd-format.sh +++ b/temps-rrd-format.sh @@ -12,7 +12,7 @@ set -o errexit set -o nounset if [ "$(id -u)" != "0" ]; then - echo "Error: this script needs to be run as root (for smartctl). Try 'sudo $0'" + echo "Error: this script needs to be run as root (for smartctl). Try 'sudo $0'" 1>&2 exit 1 fi