AdGuardHome icon indicating copy to clipboard operation
AdGuardHome copied to clipboard

Command line to add / remove filters

Open z4rn0x opened this issue 4 years ago • 5 comments

Hello! It's not a problem or a bug, but more a feature request: would it be possible to add / remove filters via a command line? I'm using Adguard on my network for my kids (parental control) and I would like to add and remove some filters easily. I'm using Adguard via Home Assistant, and the addon doesn't allow this feature, so I was thinking that a command line would be a good option. Any hope to see this feature in a near future?

z4rn0x avatar Apr 01 '22 14:04 z4rn0x

Sure, you can add or remove filters by editting AdGuardHome.yaml on your console, just use vim or sed or anything you want to edit it, that's quite simple. Make sure you have reloaded or restarted the AdGuardHome service after editting the configuration file, if you worried about your service you can check your configuration file first by --check-config flag. And you can get more information about that from AdGuardHome Wiki.

Hape this can help you :)

fernvenue avatar Apr 02 '22 01:04 fernvenue

Thank you, this is very promising! Unfortunately I can't find this file... Do you know where it's located? I'm using HA OS on a linux distro. I searched for the file with VS...

z4rn0x avatar Apr 02 '22 14:04 z4rn0x

It's in the root directory of AdGuardHome, on most Unix systems the default directory is /opt/AdGuardHome, but on macOS it's /Applications/AdGuardHome. It depends on how you installed AdGuardHome.

Or you can use find command to find the configuration file in whole / directory like this:

~# find / -name AdGuardHome.yaml
/opt/AdGuardHome/AdGuardHome.yaml

Tips: Remember to backup the configuration file before editing it, and you can use --check-config to test it before applying.

fernvenue avatar Apr 02 '22 15:04 fernvenue

Well, I guess I don't have access to it via Home Assistant. I think I will have to create a VM outside of HA. Thanks for the help!

z4rn0x avatar Apr 02 '22 18:04 z4rn0x

As @fernvenue mentioned, you can do that by editing the configuration file. The format is documented on the wiki page, and its changes are mentioned in the change log. If you have further questions related to AdGuard Home, we have the Discussion forums. I'll close this issue for now.

ainar-g avatar Apr 05 '22 11:04 ainar-g