#! /bin/bash declare progname=${0##*/} _usage () { cat <<-EOF Usage: $progname INTERFACE $progname INTERFACE filter $progname INTERFACE class EOF } if [[ $# -lt 1 ]]; then _usage exit 1 fi if [[ $# -eq 1 ]]; then /sbin/tc -s -d qdisc show dev $1 else case $2 in filter ) /sbin/tc -p filter show dev $1 ;; class ) /sbin/tc -s -d class show dev $1 ;; *) _usage; exit 1;; esac fi