Created
October 29, 2009 20:18
-
-
Save kascote/221775 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
case "$1" in | |
start) | |
tc qdisc add dev lo root handle 1: htb default 1 | |
tc class add dev lo parent 1: classid 1:1 htb rate 80kbps #ceil 80kbps | |
tc filter add dev lo protocol ip parent 1: prio 1 u32 match ip dport 80 0xffff flowid 1:1 | |
;; | |
status) | |
tc -s qdisc ls dev lo | |
echo "~~~" | |
tc -s class ls dev lo | |
echo "~~~" | |
tc -s filter ls dev lo | |
;; | |
stop) | |
tc qdisc del dev lo root | |
;; | |
*) | |
echo "usage: ./shaper start|status|stop" | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment