Created
March 16, 2012 20:40
-
-
Save fallengiants/2052529 to your computer and use it in GitHub Desktop.
Mac OS Traffic Simulator
This file contains hidden or 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/bash | |
| if [$(ipfw show | grep 'pipe 1' | wc -l) -lt 1 ]; | |
| then | |
| echo "Slowing down network, bro" | |
| ipfw add pipe 1 all from any to any | |
| ipfw pipe 1 config bw 300Kbit/s delay 400ms | |
| else | |
| echo "Speeding things up again, boss" | |
| ipfw show | grep 'pipe 1' | awk '{print $1;}' | awk '{gsub(/^0+/, "")}; 1' | xargs ipfw delete | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment