diff options
author | Paweł Krupa <pawel@krupa.net.pl> | 2018-09-13 10:24:05 +0200 |
---|---|---|
committer | Costa Tsaousis <costa@tsaousis.gr> | 2018-09-13 11:24:05 +0300 |
commit | fef1d0c06ed0ecc9da2f27655f885027315fc91e (patch) | |
tree | 83efe3d412c5ac76901a5879f6b8cd735924ca17 /charts.d/example.chart.sh | |
parent | 16b2a57ad0ab7ac40a7e1ecdebcc02c881086366 (diff) |
more linting of bash modules (#4183)
Diffstat (limited to 'charts.d/example.chart.sh')
-rw-r--r-- | charts.d/example.chart.sh | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/charts.d/example.chart.sh b/charts.d/example.chart.sh index 8602ad914e..e4b88d9ef8 100644 --- a/charts.d/example.chart.sh +++ b/charts.d/example.chart.sh @@ -47,7 +47,7 @@ example_get() { example_value4=$((8192 + (RANDOM * 16383 / 32767) )) if [ $example_count -gt 0 ] - then + then example_count=$((example_count - 1)) [ $example_last -gt 16383 ] && example_value4=$((example_last + (RANDOM * ( (32767 - example_last) / 2) / 32767))) @@ -55,8 +55,14 @@ example_get() { else example_count=$((1 + (RANDOM * 5 / 32767) )) - [ $example_last -gt 16383 -a $example_value4 -gt 16383 ] && example_value4=$((example_value4 - 16383)) - [ $example_last -le 16383 -a $example_value4 -lt 16383 ] && example_value4=$((example_value4 + 16383)) + if [ $example_last -gt 16383 ] && [ $example_value4 -gt 16383 ] + then + example_value4=$((example_value4 - 16383)) + fi + if [ $example_last -le 16383 ] && [ $example_value4 -lt 16383 ] + then + example_value4=$((example_value4 + 16383)) + fi fi example_last=$example_value4 |