From 30a27bdb0be8279c5c96c45526bf3edbc3d5484e Mon Sep 17 00:00:00 2001 From: Urbain Vaes Date: Sun, 18 Oct 2015 12:14:54 +0100 Subject: Add script to block/unblock facebook --- bin/facebook | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 bin/facebook (limited to 'bin/facebook') diff --git a/bin/facebook b/bin/facebook new file mode 100755 index 0000000..baa843f --- /dev/null +++ b/bin/facebook @@ -0,0 +1,7 @@ +#! /bin/bash +line="127.0.0.1 www.facebook.com" +if grep -q "facebook" /etc/hosts; then + zenity --password | sudo -S bash -c "sed -i '/facebook/d' /etc/hosts" +else + zenity --password | sudo -S bash -c "echo ${line} >> /etc/hosts" +fi -- cgit v1.2.3