Created
September 24, 2014 11:55
-
-
Save SebastianEngel/e069a21d6f971d896e89 to your computer and use it in GitHub Desktop.
Throttle the bandwidth used by Google Drive. See http://dwipal.tumblr.com/post/33759562048/throttle-google-drive
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 | |
# Usage: throttle_google_drive.sh <start/stop> | |
function start_ipfw_throttle() { | |
sudo ipfw pipe 1 config bw 100KByte/s | |
sudo ipfw add 1 pipe 1 ip from me to 64.18.0.0/20 | |
sudo ipfw add 1 pipe 1 ip from me to 64.233.160.0/19 | |
sudo ipfw add 1 pipe 1 ip from me to 66.102.0.0/20 | |
sudo ipfw add 1 pipe 1 ip from me to 66.249.80.0/20 | |
sudo ipfw add 1 pipe 1 ip from me to 72.14.192.0/18 | |
sudo ipfw add 1 pipe 1 ip from me to 74.125.0.0/16 | |
sudo ipfw add 1 pipe 1 ip from me to 173.194.0.0/16 | |
sudo ipfw add 1 pipe 1 ip from me to 207.126.144.0/20 | |
sudo ipfw add 1 pipe 1 ip from me to 209.85.128.0/17 | |
sudo ipfw add 1 pipe 1 ip from me to 216.239.32.0/19 | |
} | |
function stop_ipfw_throttle() { | |
sudo ipfw delete 1 | |
} | |
function show_ipfw_status() { | |
sudo ipfw show | |
} | |
case "$1" in | |
start) | |
stop_ipfw_throttle >/dev/null 2>&1 | |
start_ipfw_throttle | |
;; | |
stop) | |
stop_ipfw_throttle | |
;; | |
*) | |
echo "Usage: `basename "$0"` <start/stop>" | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment