https://github.com/agentcooper/hosts-cop
Restore /etc/hosts each time you remove sites from it (macOS)
https://github.com/agentcooper/hosts-cop
etc-hosts hosts-file macos productivity self-control
Last synced: 24 days ago
JSON representation
Restore /etc/hosts each time you remove sites from it (macOS)
- Host: GitHub
- URL: https://github.com/agentcooper/hosts-cop
- Owner: agentcooper
- Created: 2019-06-08T21:47:55.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-06-08T23:25:04.000Z (almost 7 years ago)
- Last Synced: 2025-01-13T05:29:58.887Z (over 1 year ago)
- Topics: etc-hosts, hosts-file, macos, productivity, self-control
- Language: Shell
- Homepage:
- Size: 183 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hosts cop
`/etc/hosts` file is pretty useful for blocking websites ([guide]()). Once you learn how to do it, it is also easy to unblock them.
Hosts cop will restore `/etc/hosts` file to the previous version each time you try to remove blocked sites from it.

Adding sites to `/etc/hosts` will not trigger a notification.
For macOS.
## Install
```bash
git clone https://github.com/agentcooper/hosts-cop
sudo ./hosts-cop/start
```
## Stop
```bash
# from hosts-cop directory
sudo ./stop
```
## Why `sudo`?
Script needs to run from [`/Library/LaunchDaemons/`](https://www.launchd.info/) to be able to write to `/etc/hosts`.