added second optional find, added total yield
This commit is contained in:
@@ -27,7 +27,8 @@ elif [ "$type" = "press" ]; then
|
|||||||
skip="KeyPress"
|
skip="KeyPress"
|
||||||
elif [ "$type" = "power" ]; then
|
elif [ "$type" = "power" ]; then
|
||||||
find="Environment"
|
find="Environment"
|
||||||
match="Environment(Energy|Power)\$"
|
find2="Yield"
|
||||||
|
match="Environment(Energy|Power)\$|YieldTotal\$"
|
||||||
else
|
else
|
||||||
find="hours"
|
find="hours"
|
||||||
skip="mc.4:|mc.5:"
|
skip="mc.4:|mc.5:"
|
||||||
@@ -37,6 +38,14 @@ if [ -z "$result" -o "x${result##ERR:*}" = "x" ]; then
|
|||||||
echo "error: $result"
|
echo "error: $result"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
if [ -n "$find2" ]; then
|
||||||
|
result2=`echo "find $find2"|nc localhost 8888 2>/dev/null`
|
||||||
|
if [ -z "$result2" -o "x${result2##ERR:*}" = "x" ]; then
|
||||||
|
echo "error: $result2"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
result="$result\n$result2"
|
||||||
|
fi
|
||||||
sensors=`echo "$result"|sed -e 's# =.*$##' -e 's# #:#'|egrep "$match"`
|
sensors=`echo "$result"|sed -e 's# =.*$##' -e 's# #:#'|egrep "$match"`
|
||||||
if [ -n "$skip" ]; then
|
if [ -n "$skip" ]; then
|
||||||
sensors=`echo "$sensors"|egrep -v "$skip"`
|
sensors=`echo "$sensors"|egrep -v "$skip"`
|
||||||
|
|||||||
Reference in New Issue
Block a user