diff options
author | Simon Nagl <simonnagl@aim.com> | 2016-04-28 22:41:15 +0200 |
---|---|---|
committer | Simon Nagl <simonnagl@aim.com> | 2016-04-29 02:31:15 +0200 |
commit | ec28e63c30962818dab315d64ee4da10005e47fd (patch) | |
tree | e4697d0be4d11c27726366b97351fa378722a3f4 /charts.d/sensors.chart.sh | |
parent | 444aab651daab58c4e727fffe74ea21bc920cdab (diff) |
Fix #282 use modern arithmetic expansion in shell
Use $((.*)) instead of $[.*]
The later one is old syntax
Diffstat (limited to 'charts.d/sensors.chart.sh')
-rwxr-xr-x | charts.d/sensors.chart.sh | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/charts.d/sensors.chart.sh b/charts.d/sensors.chart.sh index 946de54068..19e9385866 100755 --- a/charts.d/sensors.chart.sh +++ b/charts.d/sensors.chart.sh @@ -129,7 +129,7 @@ sensors_create() { files="$( sensors_check_files $files )" files="$( sensors_check_temp_type $files )" [ -z "$files" ] && continue - echo "CHART sensors.temp_$id '' '$name Temperature' 'Celsius' 'temperature' 'sensors.temp' line $[sensors_priority + 1] $sensors_update_every" + echo "CHART sensors.temp_$id '' '$name Temperature' 'Celsius' 'temperature' 'sensors.temp' line $((sensors_priority + 1)) $sensors_update_every" echo >>$TMP_DIR/sensors.sh "echo \"BEGIN sensors.temp_$id \$1\"" divisor=1000 ;; @@ -138,7 +138,7 @@ sensors_create() { files="$( ls $path/in*_input 2>/dev/null )" files="$( sensors_check_files $files )" [ -z "$files" ] && continue - echo "CHART sensors.volt_$id '' '$name Voltage' 'Volts' 'voltage' 'sensors.volt' line $[sensors_priority + 2] $sensors_update_every" + echo "CHART sensors.volt_$id '' '$name Voltage' 'Volts' 'voltage' 'sensors.volt' line $((sensors_priority + 2)) $sensors_update_every" echo >>$TMP_DIR/sensors.sh "echo \"BEGIN sensors.volt_$id \$1\"" divisor=1000 ;; @@ -147,7 +147,7 @@ sensors_create() { files="$( ls $path/curr*_input 2>/dev/null )" files="$( sensors_check_files $files )" [ -z "$files" ] && continue - echo "CHART sensors.curr_$id '' '$name Current' 'Ampere' 'current' 'sensors.curr' line $[sensors_priority + 3] $sensors_update_every" + echo "CHART sensors.curr_$id '' '$name Current' 'Ampere' 'current' 'sensors.curr' line $((sensors_priority + 3)) $sensors_update_every" echo >>$TMP_DIR/sensors.sh "echo \"BEGIN sensors.curr_$id \$1\"" divisor=1000 ;; @@ -156,7 +156,7 @@ sensors_create() { files="$( ls $path/power*_input 2>/dev/null )" files="$( sensors_check_files $files )" [ -z "$files" ] && continue - echo "CHART sensors.power_$id '' '$name Power' 'Watt' 'power' 'sensors.power' line $[sensors_priority + 4] $sensors_update_every" + echo "CHART sensors.power_$id '' '$name Power' 'Watt' 'power' 'sensors.power' line $((sensors_priority + 4)) $sensors_update_every" echo >>$TMP_DIR/sensors.sh "echo \"BEGIN sensors.power_$id \$1\"" divisor=1000000 ;; @@ -165,7 +165,7 @@ sensors_create() { files="$( ls $path/fan*_input 2>/dev/null )" files="$( sensors_check_files $files )" [ -z "$files" ] && continue - echo "CHART sensors.fan_$id '' '$name Fans Speed' 'Rotations / Minute' 'fans' 'sensors.fans' line $[sensors_priority + 5] $sensors_update_every" + echo "CHART sensors.fan_$id '' '$name Fans Speed' 'Rotations / Minute' 'fans' 'sensors.fans' line $((sensors_priority + 5)) $sensors_update_every" echo >>$TMP_DIR/sensors.sh "echo \"BEGIN sensors.fan_$id \$1\"" ;; @@ -173,7 +173,7 @@ sensors_create() { files="$( ls $path/energy*_input 2>/dev/null )" files="$( sensors_check_files $files )" [ -z "$files" ] && continue - echo "CHART sensors.energy_$id '' '$name Energy' 'Joule' 'energy' 'sensors.energy' areastack $[sensors_priority + 6] $sensors_update_every" + echo "CHART sensors.energy_$id '' '$name Energy' 'Joule' 'energy' 'sensors.energy' areastack $((sensors_priority + 6)) $sensors_update_every" echo >>$TMP_DIR/sensors.sh "echo \"BEGIN sensors.energy_$id \$1\"" algorithm="incremental" divisor=1000000 @@ -183,7 +183,7 @@ sensors_create() { files="$( ls $path/humidity*_input 2>/dev/null )" files="$( sensors_check_files $files )" [ -z "$files" ] && continue - echo "CHART sensors.humidity_$id '' '$name Humidity' 'Percent' 'humidity' 'sensors.humidity' line $[sensors_priority + 7] $sensors_update_every" + echo "CHART sensors.humidity_$id '' '$name Humidity' 'Percent' 'humidity' 'sensors.humidity' line $((sensors_priority + 7)) $sensors_update_every" echo >>$TMP_DIR/sensors.sh "echo \"BEGIN sensors.humidity_$id \$1\"" divisor=1000 ;; |