From 6995742e591fcd11088801dced1d08ef83c8da21 Mon Sep 17 00:00:00 2001 From: Lars Kruse Date: Tue, 18 Sep 2018 03:07:05 +0200 Subject: [PATCH] Plugins tc_*: check existence of "tc" during autoconf --- plugins/network/tc_ | 8 +++++--- plugins/network/tc_drops_ | 8 +++++--- plugins/network/tc_packets_ | 8 +++++--- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/plugins/network/tc_ b/plugins/network/tc_ index 6b60fb93..1b774e46 100755 --- a/plugins/network/tc_ +++ b/plugins/network/tc_ @@ -50,10 +50,12 @@ mytc() { case "$1" in autoconf) - if [ -r /proc/net/dev ]; then - echo yes - else + if [ ! -r /proc/net/dev ]; then echo "no (/proc/net/dev not found)" + elif [ ! -x /sbin/tc ]; then + echo "no (missing 'tc' executable)" + else + echo yes fi exit 0 ;; diff --git a/plugins/network/tc_drops_ b/plugins/network/tc_drops_ index 6169bfd4..ab049c64 100755 --- a/plugins/network/tc_drops_ +++ b/plugins/network/tc_drops_ @@ -21,10 +21,12 @@ mytc() { case $1 in autoconf) - if [ -r /proc/net/dev ]; then - echo yes - else + if [ ! -r /proc/net/dev ]; then echo "no (/proc/net/dev not found)" + elif ! which tc >/dev/null; then + echo "no (missing 'tc' executable)" + else + echo yes fi exit 0 ;; diff --git a/plugins/network/tc_packets_ b/plugins/network/tc_packets_ index 42a5d9c5..0a280c2e 100755 --- a/plugins/network/tc_packets_ +++ b/plugins/network/tc_packets_ @@ -21,10 +21,12 @@ mytc() { case $1 in autoconf) - if [ -r /proc/net/dev ]; then - echo yes - else + if [ ! -r /proc/net/dev ]; then echo "no (/proc/net/dev not found)" + elif ! which tc >/dev/null; then + echo "no (missing 'tc' executable)" + else + echo yes fi exit 0 ;;