Skip to content

Instantly share code, notes, and snippets.

@gartmeier
Created July 6, 2012 09:07
Show Gist options
  • Save gartmeier/3059092 to your computer and use it in GitHub Desktop.
Save gartmeier/3059092 to your computer and use it in GitHub Desktop.
Mac FireWall (ipfw) Bandwidth Control Script
#!/bin/bash
SUDO_PASSWD='***'
echo $SUDO_PASSWD | sudo -S ipfw pipe 1 config bw $1kbit/s
echo $SUDO_PASSWD | sudo -S ipfw add pipe 1 dst-ip 0.0.0.0/0
read -p "hit enter to flush..." yn
echo $SUDO_PASSWD | sudo -S ipfw flush
@gartmeier
Copy link
Author

I have to replace sudo with SUID or something suitable

@gartmeier
Copy link
Author

KByte/s is possible too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment