From cb28f6e4591864ca68fb4c37044e0dae6d1e3b03 Mon Sep 17 00:00:00 2001 From: Jonathan McCrohan Date: Tue, 21 Apr 2015 23:16:14 +0100 Subject: [PATCH] muninlite: correctly parse ifname with - char Rewrote Jo-Philipp Wich's patch so it applies to source files rather than generated files. Closes #701 Signed-off-by: Jonathan McCrohan --- admin/muninlite/Makefile | 2 +- .../patches/220-modify-ifname-parser.patch | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 admin/muninlite/patches/220-modify-ifname-parser.patch diff --git a/admin/muninlite/Makefile b/admin/muninlite/Makefile index 1c1793edd..46fc8c4f8 100644 --- a/admin/muninlite/Makefile +++ b/admin/muninlite/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=muninlite PKG_VERSION:=1.0.4 -PKG_RELEASE:=5 +PKG_RELEASE:=6 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=@SF/$(PKG_NAME) diff --git a/admin/muninlite/patches/220-modify-ifname-parser.patch b/admin/muninlite/patches/220-modify-ifname-parser.patch new file mode 100644 index 000000000..95655cfbd --- /dev/null +++ b/admin/muninlite/patches/220-modify-ifname-parser.patch @@ -0,0 +1,22 @@ +--- a/plugins/if_ ++++ b/plugins/if_ +@@ -26,7 +26,7 @@ config_if() { + fi + } + fetch_if() { +- IINFO=$(grep "$1:" /proc/net/dev | cut -d: -f2 | sed -e 's/ / /g') ++ IINFO=$(cat /proc/net/dev | sed -e 's/-/_/g' | grep "$1:" | cut -d: -f2 | sed -e 's/ */ /g' -e 's/^[ \t]*//') + echo "down.value" $(echo $IINFO | cut -d\ -f1) + echo "up.value" $(echo $IINFO | cut -d\ -f9) + } +--- a/plugins/if_err_ ++++ b/plugins/if_err_ +@@ -15,7 +15,7 @@ config_if_err() { + echo "trans.warning 1" + } + fetch_if_err() { +- IINFO=$(grep "$1:" /proc/net/dev | cut -d: -f2 | sed -e 's/ / /g') ++ IINFO=$(cat /proc/net/dev | sed -e 's/-/_/g' | grep "$1:" | cut -d: -f2 | sed -e 's/ */ /g' -e 's/^[ \t]*//') + echo "rcvd.value" $(echo $IINFO | cut -d\ -f3) + echo "trans.value" $(echo $IINFO | cut -d\ -f11) + }