Skip to content

Commit

Permalink
Plugins tc_*: check existence of "tc" during autoconf
Browse files Browse the repository at this point in the history
  • Loading branch information
sumpfralle committed Sep 18, 2018
1 parent 272220c commit 6995742
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
8 changes: 5 additions & 3 deletions plugins/network/tc_
Expand Up @@ -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
;;
Expand Down
8 changes: 5 additions & 3 deletions plugins/network/tc_drops_
Expand Up @@ -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
;;
Expand Down
8 changes: 5 additions & 3 deletions plugins/network/tc_packets_
Expand Up @@ -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
;;
Expand Down

0 comments on commit 6995742

Please sign in to comment.