Created
February 27, 2021 10:24
-
-
Save NNBnh/15d18a005c6ab849855bddfad54ec044 to your computer and use it in GitHub Desktop.
Install Hosts ad-block quickly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Values | |
TMPDIR="${TMPDIR:-/tmp}" | |
# Start | |
curl -fsSL 'https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts' --create-dirs --output "$TMPDIR/hosts" \ | |
&& printf '%s' "127.0.1.1 $(hostname)" >> "$TMPDIR/hosts" \ | |
&& sudo mv "$TMPDIR/hosts" '/etc/hosts' | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment