220-modify-ifname-parser.patch 748 B

12345678910111213141516171819202122
  1. --- a/plugins/if_
  2. +++ b/plugins/if_
  3. @@ -26,7 +26,7 @@ config_if() {
  4. fi
  5. }
  6. fetch_if() {
  7. - IINFO=$(grep "$1:" /proc/net/dev | cut -d: -f2 | sed -e 's/ / /g')
  8. + IINFO=$(grep "$1:" /proc/net/dev | cut -d: -f2 | sed -e 's/ */ /g' -e 's/^[ \t]*//')
  9. echo "down.value" $(echo $IINFO | cut -d\ -f1)
  10. echo "up.value" $(echo $IINFO | cut -d\ -f9)
  11. }
  12. --- a/plugins/if_err_
  13. +++ b/plugins/if_err_
  14. @@ -15,7 +15,7 @@ config_if_err() {
  15. echo "trans.warning 1"
  16. }
  17. fetch_if_err() {
  18. - IINFO=$(grep "$1:" /proc/net/dev | cut -d: -f2 | sed -e 's/ / /g')
  19. + IINFO=$(grep "$1:" /proc/net/dev | cut -d: -f2 | sed -e 's/ */ /g' -e 's/^[ \t]*//')
  20. echo "rcvd.value" $(echo $IINFO | cut -d\ -f3)
  21. echo "trans.value" $(echo $IINFO | cut -d\ -f11)
  22. }