Because sometimes you don't need the entire pi to block ads
easymasq is a simple script designed to pull from AdBlock Plus / UBlock Domain Lists or DNS Host Files (PiHole) and generate merged host file for use in DNSMASQ or /etc/hosts.
this tool is meant to be used on very lightweight systems, or when you do not wish to need many dependencies. it requires almost no resources and does not automate anything. that is left to your discretion, meaning you can set it up to run daily, weekly, monthly, or manually.
because many embedded systems use busybox, toybox, or similar lightweight environments getopt may not exist in every situation. i tried to keep the commands simple, so it shouldn't cause too much trouble. eventually i'll find a way to add getopt in a way that will allow it to gracefully fail.
you need wget or curl, sed, and tr. busybox and toybox versions of these tools should be compatible, but its recommend you have GNU Sed and a full wget if you can to avoid possible issues.
chmod +x easymasq.sh
and you're ready to go!
its pretty simple, just run the command
./easymasq BLOCKLIST HOSTFILE
some may have noticed it has an optional parameter
./easymasq BLOCKLIST HOSTFILE plain
this will output a hostname only list, useful for further processing or effort from another script.