Skip to content

Instantly share code, notes, and snippets.

@saimonmoore
Created May 23, 2013 10:24
Show Gist options
  • Save saimonmoore/5635145 to your computer and use it in GitHub Desktop.
Save saimonmoore/5635145 to your computer and use it in GitHub Desktop.
turn internet on/off for a short while
#!/bin/bash
PORTS="80 443"
UNDO=
for p in $PORTS
do
iptables -I OUTPUT -p tcp --dport $p -j DROP -v
UNDO="$UNDO iptables -D OUTPUT -p tcp --dport $p -j DROP -v;"
done
echo $UNDO | at now + 3 min
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment