Skip to content

Commit

Permalink
Add -V argument to print version
Browse files Browse the repository at this point in the history
  • Loading branch information
hkbakke committed Jan 13, 2017
1 parent 46a4125 commit 423d3b2
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/tc-gen.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash


VERSION="1.1.0"
TC=$(which tc)
ETHTOOL=$(which ethtool)
IP=$(which ip)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}"
Expand All @@ -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
Expand Down

0 comments on commit 423d3b2

Please sign in to comment.