Skip to content

Instantly share code, notes, and snippets.

@timss
Created April 5, 2016 13:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save timss/1be582353f679282c60a546749afa4b7 to your computer and use it in GitHub Desktop.
Save timss/1be582353f679282c60a546749afa4b7 to your computer and use it in GitHub Desktop.
# Block facebook.com mon-fri, 08:00 - 17:00, from desktop net
# Fetches all subnets registered to Facebook and it's domain aliases
for i in $(whois -h whois.radb.net -- '-i origin AS32934' |
awk '/^route:/ { if(!uniq[$2]++) print $2 }'); do
$ipt -A FORWARD -s $desktop_net -d $i \
-m time --timestart 08:00 --timestop 17:00 --weekdays Mon,Tue,Wed,Thu,Fri \
-j DROP
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment