Skip to content

Latest commit

 

History

History
20 lines (16 loc) · 438 Bytes

README.md

File metadata and controls

20 lines (16 loc) · 438 Bytes

host_blocker

Bash script for blocking / unblocking hosts in /etc/hosts

Config

Edit script file and add desired domains that should be blocked:

hosts_to_block=("facebook.com" "imdb.com" "instagram.com")

Usage

Run by: Run script providing path to hosts file and desired status as arguments:

# Add blocked domains
./host_blocker.sh /etc/hosts 1

# Remove domain blocking
./host_blocker.sh /etc/hosts 0