-
Notifications
You must be signed in to change notification settings - Fork 0
/
tc_codelwifi.bash
executable file
·76 lines (51 loc) · 1.05 KB
/
tc_codelwifi.bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
#
# http://manpages.ubuntu.com/manpages/xenial/en/man8/tc-fq_codel.8.html
# https://www.bufferbloat.net/projects/codel/wiki/RRUL_Rogues_Gallery/
# http://netseminar.stanford.edu/seminars/Inside_Codel_and_Fq_Codel.pdf
#
TC=/sbin/tc
IF=wlxc04a001e7636 # Interface
start() {
#$TC qdisc add dev $IF root fq_codel limit 300
$TC qdisc add dev $IF parent 1:1 handle 10: fq_codel limit 300
show
}
stop() {
$TC qdisc del dev $IF parent 1:1 handle 10: fq_codel limit 300
}
restart() {
stop
sleep 1
start
}
show() {
$TC -s qdisc ls dev $IF
}
case "$1" in
start)
echo -n "Starting CODEL shaping: "
start
echo "done"
;;
stop)
echo -n "Stopping CODEL shaping: "
stop
echo "done"
;;
restart)
echo -n "Restarting CODEL shaping: "
restart
echo "done"
;;
show)
echo "qdisc status for $IF:"
show
echo ""
;;
*)
pwd=$(pwd)
echo "Usage: $(/usr/bin/dirname $pwd)/tc_codel.bash {start|stop|restart|show}"
;;
esac
exit 0