Update power.inc.sh
This commit is contained in:
@@ -18,11 +18,11 @@ AVERAGEPOWER(){
|
||||
total_amp=0
|
||||
total_watt=0
|
||||
while IFS=$'\t' read date amp watt ;do
|
||||
if [ "${amp}" != "" ] && [ "${amp}" != "NULL" ]; then
|
||||
if [ "${amp}" != "" ] && [ "${amp}" != "0" ] && [ "${amp}" != "NULL" ] && [[ "${amp}" =~ ^[0-9]+(\.[0-9]+)?$ ]]; then
|
||||
total_amp=$(bc <<< "scale=2; ${total_amp}+${amp}")
|
||||
((logsfound_amp++))
|
||||
fi
|
||||
if [ "${watt}" != "" ] && [ "${watt}" != "NULL" ]; then
|
||||
if [ "${watt}" != "" ] && [ "${watt}" != "0" ] && [ "${watt}" != "NULL" ] && [[ "${watt}" =~ ^[0-9]+(\.[0-9]+)?$ ]]; then
|
||||
total_watt=$(bc <<< "scale=2; ${total_watt}+${watt}")
|
||||
((logsfound_watt++))
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user