This script was written for fun and it hasn't been tested for edge cases, use at your own risk.
Get help by typing
./adbr -h
Ad blocker inspired by AdAway
Usage: adbr [OPTIONS]
Options:
-b Backup the current hosts file manually
-r Restore the original hosts file from the backup
-v Print the version string of this script
-h Print this help message
You need to populate the URL file with ad server URLs. A good place to start is Steven Black's hosts.
Afterwards run the script without arguments to generate and install the hosts file
./adbr