summaryrefslogtreecommitdiffstats
path: root/plugins.d/charts.d.plugin
diff options
context:
space:
mode:
authorLennart Weller <lhw@ring0.de>2016-05-25 10:36:24 +0000
committerLennart Weller <lhw@ring0.de>2016-05-25 10:36:24 +0000
commitb4f64f72a3e4bf590c60b0cbd6cd365aa1a58542 (patch)
treee6706c727a1fedb44da614453ad3e429a7403a9b /plugins.d/charts.d.plugin
parentImported Upstream version 1.1.0 (diff)
downloadnetdata-b4f64f72a3e4bf590c60b0cbd6cd365aa1a58542.tar.xz
netdata-b4f64f72a3e4bf590c60b0cbd6cd365aa1a58542.zip
Imported Upstream version 1.2.0upstream/1.2.0
Diffstat (limited to '')
-rwxr-xr-xplugins.d/charts.d.plugin12
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins.d/charts.d.plugin b/plugins.d/charts.d.plugin
index 27b294709..2824fa3c6 100755
--- a/plugins.d/charts.d.plugin
+++ b/plugins.d/charts.d.plugin
@@ -84,7 +84,7 @@ time_divisor=50
# number of seconds to run without restart
# after this time, charts.d.plugin will exit
# netdata will restart it
-restart_timeout=$[3600 * 4]
+restart_timeout=$((3600 * 4))
# check if the charts.d plugins are using global variables
# they should not.
@@ -247,7 +247,7 @@ float2int() {
# echo >&2 "value='${1}' f='${f}', m='${m}'"
# the length of the multiplier - 1
- l=$[ ${#m} - 1 ]
+ l=$(( ${#m} - 1 ))
# check if the number is in scientific notation
if [[ ${f} =~ ^[[:space:]]*(-)?[0-9.]+(e|E)(\+|-)[0-9]+ ]]
@@ -269,7 +269,7 @@ float2int() {
# strip leading zeros from the integer part
# base 10 convertion
- a=$[10#$a]
+ a=$((10#$a))
# check the length of the decimal part
# against the length of the multiplier
@@ -281,16 +281,16 @@ float2int() {
elif [ ${#b} -lt ${l} ]
then
# too few digits - pad with zero on the right
- local z="00000000000000000000000" r=$[l - ${#b}]
+ local z="00000000000000000000000" r=$((l - ${#b}))
b="${b}${z:0:${r}}"
fi
# strip leading zeros from the decimal part
# base 10 convertion
- b=$[10#$b]
+ b=$((10#$b))
# store the result
- FLOAT2INT_RESULT=$[ (a * m) + b ]
+ FLOAT2INT_RESULT=$(( (a * m) + b ))
#echo >&2 "FLOAT2INT_RESULT='${FLOAT2INT_RESULT}'"
}