summaryrefslogtreecommitdiffstats
path: root/plugins.d/charts.d.dryrun-helper.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2018-11-07 12:22:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2018-11-07 12:22:44 +0000
commit1e6c93250172946eeb38e94a92a1fd12c9d3011e (patch)
tree8ca5e16dfc7ad6b3bf2738ca0a48408a950f8f7e /plugins.d/charts.d.dryrun-helper.sh
parentUpdate watch file (diff)
downloadnetdata-1e6c93250172946eeb38e94a92a1fd12c9d3011e.tar.xz
netdata-1e6c93250172946eeb38e94a92a1fd12c9d3011e.zip
Merging upstream version 1.11.0+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'plugins.d/charts.d.dryrun-helper.sh')
-rwxr-xr-xplugins.d/charts.d.dryrun-helper.sh73
1 files changed, 0 insertions, 73 deletions
diff --git a/plugins.d/charts.d.dryrun-helper.sh b/plugins.d/charts.d.dryrun-helper.sh
deleted file mode 100755
index 8142f9882..000000000
--- a/plugins.d/charts.d.dryrun-helper.sh
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/usr/bin/env bash
-
-# will stop the script for any error
-set -e
-
-me="$0"
-name="$1"
-chart="$2"
-conf="$3"
-
-can_diff=1
-
-tmp1="`mktemp`"
-tmp2="`mktemp`"
-
-myset() {
- set | grep -v "^_=" | grep -v "^PIPESTATUS=" | grep -v "^BASH_LINENO="
-}
-
-# save 2 'set'
-myset >"$tmp1"
-myset >"$tmp2"
-
-# make sure they don't differ
-diff "$tmp1" "$tmp2" >/dev/null 2>&1
-if [ $? -ne 0 ]
-then
- # they differ, we cannot do the check
- echo >&2 "$me: cannot check with diff."
- can_diff=0
-fi
-
-# do it again, now including the script
-myset >"$tmp1"
-
-# include the plugin and its config
-if [ -f "$conf" ]
-then
- . "$conf"
- if [ $? -ne 0 ]
- then
- echo >&2 "$me: cannot load config file $conf"
- rm "$tmp1" "$tmp2"
- exit 1
- fi
-fi
-
-. "$chart"
-if [ $? -ne 0 ]
-then
- echo >&2 "$me: cannot load chart file $chart"
- rm "$tmp1" "$tmp2"
- exit 1
-fi
-
-# remove all variables starting with the plugin name
-myset | grep -v "^$name" >"$tmp2"
-
-if [ $can_diff -eq 1 ]
-then
- # check if they are different
- # make sure they don't differ
- diff "$tmp1" "$tmp2" >&2
- if [ $? -ne 0 ]
- then
- # they differ
- rm "$tmp1" "$tmp2"
- exit 1
- fi
-fi
-
-rm "$tmp1" "$tmp2"
-exit 0