From c276feb339597537b03d8cb885ee1167c9a61727 Mon Sep 17 00:00:00 2001 From: Denny Page Date: Tue, 1 Mar 2016 22:14:36 -0800 Subject: [PATCH] Confirm that the rrd file is writable before starting --- rrd/dpinger_rrd_update | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rrd/dpinger_rrd_update b/rrd/dpinger_rrd_update index 46a2d48..be6753b 100755 --- a/rrd/dpinger_rrd_update +++ b/rrd/dpinger_rrd_update @@ -15,6 +15,11 @@ dpinger=/usr/local/bin/dpinger rrdfile="${name}.rrd" +if [ \! -w ${rrdfile} ] +then + echo "$0: file \"${rrdfile}\" does not exist or is not writable" + exit 1 +fi ${dpinger} -f ${options} -s 500m -t 60s -r 60s ${targetip} | while read -r latency stddev loss; do