diff options
author | Urbain Vaes <urbain@vaes.uk> | 2015-10-18 12:14:54 +0100 |
---|---|---|
committer | Urbain Vaes <urbain@vaes.uk> | 2015-10-18 12:14:54 +0100 |
commit | 30a27bdb0be8279c5c96c45526bf3edbc3d5484e (patch) | |
tree | 15ec84f886a3c878826013af141f2b42e1486d59 /bin/facebook | |
parent | b27f698c6c828dadcce372f7d086eff7d9e14391 (diff) |
Add script to block/unblock facebook
Diffstat (limited to 'bin/facebook')
-rwxr-xr-x | bin/facebook | 7 |
1 files changed, 7 insertions, 0 deletions
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 |