From: Kevin Darbyshire-Bryant Date: Mon, 25 May 2020 14:30:34 +0000 (+0100) Subject: collectd: sqm_collect: tidy interval string handling X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=c2c91ea99e5fb7d4798116888b31f8fd9117d8ee;p=openwrt-packages.git collectd: sqm_collect: tidy interval string handling Signed-off-by: Kevin Darbyshire-Bryant --- diff --git a/utils/collectd/Makefile b/utils/collectd/Makefile index 60bed8e91..5dc542349 100644 --- a/utils/collectd/Makefile +++ b/utils/collectd/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=collectd PKG_VERSION:=5.11.0 -PKG_RELEASE:=6 +PKG_RELEASE:=7 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://collectd.org/files/ \ diff --git a/utils/collectd/files/exec-scripts/sqm_collectd.sh b/utils/collectd/files/exec-scripts/sqm_collectd.sh index f158056e8..ad84fc762 100755 --- a/utils/collectd/files/exec-scripts/sqm_collectd.sh +++ b/utils/collectd/files/exec-scripts/sqm_collectd.sh @@ -3,7 +3,7 @@ . /usr/share/libubox/jshn.sh HOSTNAME="${COLLECTD_HOSTNAME:-localhost}" -INTERVAL="${COLLECTD_INTERVAL:-60.000}" +INTERVAL="${COLLECTD_INTERVAL:-60}" handle_cake() { local ifc ifr tin i @@ -79,8 +79,7 @@ process_qdisc() { local ifc jsn ifc="$1" - jsn=$(tc -s -j qdisc show dev "$ifc") - [ $? ] || return + jsn=$(tc -s -j qdisc show dev "$ifc") || return # strip leading & trailing [] jsn="${jsn#[}" ; jsn="${jsn%]}" @@ -104,5 +103,5 @@ while true ; do for ifc in "$@" ; do process_qdisc "$ifc" done - sleep "${INTERVAL%.000}" + sleep "${INTERVAL%%.*}" done