Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quick enable/disable hblock #61

Closed
mindyourlifeguide opened this issue Nov 11, 2020 · 11 comments
Closed

quick enable/disable hblock #61

mindyourlifeguide opened this issue Nov 11, 2020 · 11 comments

Comments

@mindyourlifeguide
Copy link

mindyourlifeguide commented Nov 11, 2020

Tell me how to quickly turn it on and off now? This solution stopped working after version 3.0.

@hectorm
Copy link
Owner

hectorm commented Nov 11, 2020

This should work the same as before, by overwriting the HBLOCK_SOURCES environment variable.

  • Disable: HBLOCK_SOURCES='' hblock
  • Enable: hblock
[hectorm@hydrogen ~]$ HBLOCK_SOURCES='' hblock -qO-
# Generated with:  https://github.com/hectorm/hblock
# Blocked domains: 1

# BEGIN HEADER
127.0.0.1       localhost hydrogen
255.255.255.255 broadcasthost
::1             localhost hydrogen
::1             ip6-localhost ip6-loopback
fe00::0         ip6-localnet
ff00::0         ip6-mcastprefix
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters
ff02::3         ip6-allhosts
# END HEADER

# BEGIN BLOCKLIST
0.0.0.0 hblock-check.molinero.dev
# END BLOCKLIST

@mindyourlifeguide
Copy link
Author

Not working.

Peek 2020-11-12 10-37

@mindyourlifeguide
Copy link
Author

I found a way to disable hblock.
hblock -S /dev/null
Is it possible to disable this or is it worth figuring out why that command (HBLOCK_SOURCES='' hblock) does not work?

@hectorm
Copy link
Owner

hectorm commented Nov 12, 2020

You can provide the output of the following command to know what is happening:

HBLOCK_SOURCES='' sh -x "$(command -v hblock)"

@hectorm
Copy link
Owner

hectorm commented Nov 12, 2020

However, the next version will support -S none to disable hBlock without having to resort to this type of workarounds.

This functionality is already implemented in the dev branch, but it is still experimental and subject to changes.

@mindyourlifeguide
Copy link
Author

Here is the console output:
Peek 2020-11-12 13-16

Then I will turn off the method above for now, and with the update I will switch to the official method.
Thanks!

@hectorm
Copy link
Owner

hectorm commented Nov 12, 2020

Could you please paste the terminal output instead of an image so I can read it in detail?

@mindyourlifeguide
Copy link
Author

Of course, keep logfile.txt

@mindyourlifeguide
Copy link
Author

Can I close this issue?

@hectorm
Copy link
Owner

hectorm commented Nov 12, 2020

Now I understand why it does not work, the presence of the /etc/hblock/sources.list file has priority over the environment variable.

This will be solved in the next version and since you have found a workaround, I consider the issue solved.

Thanks for reporting this.

@hectorm hectorm closed this as completed Nov 12, 2020
@mindyourlifeguide
Copy link
Author

mindyourlifeguide commented Nov 12, 2020

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants