Created
April 14, 2011 16:28
-
-
Save jdewind/919851 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
slow_connection () { | |
if [ -z $1 ]; then | |
echo "Bandwidth must be provided" | |
return | |
fi | |
default_port="80" | |
sudo ipfw pipe 1 config bw $1KByte/s | |
sudo ipfw add 1 pipe 1 src-port ${2:-$default_port} | |
} | |
edge_connection() { | |
slow_connection 56 $1 | |
} | |
3g_connection() { | |
slow_connection 200 $1 | |
} | |
alias restore_connection="sudo ipfw delete 1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment