Add -V argument to print version

This commit is contained in:
hk 2017-01-13 08:57:52 +01:00
parent 46a4125980
commit 423d3b2401
1 changed files with 12 additions and 1 deletions

View File

@ -1,6 +1,7 @@
#!/bin/bash
VERSION="1.1.0"
TC=$(which tc)
ETHTOOL=$(which ethtool)
IP=$(which ip)
@ -57,6 +58,8 @@ OPTIONS
a ceil of 70 mbit/s and a priority of 2.
-x
Clear all traffic control config on interface.
-V
Print version and exit.
EXAMPLES OF COMMON USE
Shape egress to 25 mbit/s
@ -118,6 +121,10 @@ EXCLUDE TRAFFIC FROM INGRESS FILTERING
EOF
}
print_version () {
echo "tc-gen.sh v${VERSION}"
}
get_htb_quantum () {
# Takes input rate in mbit/s as parameter
local RATE=$1
@ -357,7 +364,7 @@ apply_ingress_policing () {
# All rates should be given in mbit/s
while getopts ":i:u:d:b:f:q:c:x" OPT; do
while getopts ":i:u:d:b:f:q:c:xV" OPT; do
case $OPT in
i)
IF_NAME="${OPTARG}"
@ -380,6 +387,10 @@ while getopts ":i:u:d:b:f:q:c:x" OPT; do
x)
CLEAR_CONFIG=1
;;
V)
print_version
exit 0
;;
\?)
print_usage
exit 1