collectd: sqm_collectd improve interface name filter
authorKevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Thu, 7 May 2020 08:43:27 +0000 (09:43 +0100)
committerKevin Darbyshire-Bryant <6500011+ldir-EDB0@users.noreply.github.com>
Thu, 7 May 2020 09:48:45 +0000 (10:48 +0100)
Increase the range of characters that get substituted by '_' so the
shell doesn't complain about illegal variable names.

Primarily done to catch '.' and '-' but who knows what funnies will
appear in i/f names.

It's a shame that busybox ash doesn't understand :alnum:

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
utils/collectd/Makefile
utils/collectd/files/exec-scripts/sqm_collectd.sh

index 96080f5f0228c5bc69fddf675f1e0ed0750858e9..29aec706f8a4baa7d1514a121cfa0cc8deb363c9 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=collectd
 PKG_VERSION:=5.11.0
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://collectd.org/files/ \
index 1fda2cb4072bbc8e4792dcd4ef56189da498aa1f..a2927854e24ff48eab433f8bab9d8a6e5c374180 100755 (executable)
@@ -9,7 +9,7 @@ handle_cake() {
        local ifc ifr tin i
 
        ifc="$1"
-       ifr="${ifc//./_}"
+       ifr="${ifc//[!0-9A-Za-z]/_}"
 
        # Overall
        json_get_vars bytes packets drops backlog qlen