Permalink
Browse files

Revert "if_: check for non-empty and >0 before reporting speed (thank…

…s to ssm)"

This reverts commit f982751.

This causes a syntax error when $SPEED is empty; see issue #771 for
example. The original test already did the right thing when $SPEED is
empty: the check for $SPEED being greater than 0 returned false, so
the function continued to the method for determining speed.
  • Loading branch information...
1 parent 8db85de commit 290d5ac2be02ced4d09fda68dc561fcf082c9cbf @kenyon kenyon committed Jan 3, 2017
Showing with 1 addition and 1 deletion.
  1. +1 −1 plugins/node.d.linux/if_
View
@@ -90,7 +90,7 @@ findspeed_mbps() {
# iwlist first)
if [[ -r /sys/class/net/$INTERFACE/speed ]]; then
SPEED=$(cat /sys/class/net/$INTERFACE/speed 2>/dev/null)
- if [ -n "$SPEED" -a "$SPEED" -gt "0" ]; then
+ if [[ "$SPEED" -gt 0 ]]; then
echo $SPEED
return
fi

0 comments on commit 290d5ac

Please sign in to comment.