yubiuser/pihole_adlist_tool

Wrong detection of PIHOLE_DOCKER?!

thomasmerz opened this issue ยท 8 comments

I executed docker exec -it pihole bash and then:

root@pihole-merz-nimbus:/etc/pihole# ./pihole_adlist_tool
  *** Pihole Adlist Tool 2.6 ***
   ++++++++ Info ++++++++
  [i]  PIHOLE_DOCKER: No
  [i]  PIHOLE_DNSMASQ_VERSION: 2.87test4-18
  [i]  SQLITE_VERSION: 3.37.1
  [i]  DAYS_REQUESTED: 30
  [i]  TOP: Not shown
  [i]  SORT_ORDER: id ASC
  [i]  UNIQUE: Not shown
  [i]  REGEX_MODE: Disabled
  [i]  There is an update available: 2.6.0
โ€ฆ

So I can say for sure that this Pi-Hole is running within Docker ๐Ÿ˜† But your really nice script is detecting this wrong/not.

Also the update-detection is not correct - or version of 2.6 is set wrong and should be 2.6.0!?

Also the update-detection is not correct - or version of 2.6 is set wrong and should be 2.6.0!?

It's only a string comparison. I should have set the version to 2.6.0 ;-)


What's the output of

command -v docker

docker ps -q -f status="running" -f name="pihole"

docker ps -f "name=pihole" -q

docker exec -it pihole bash

Wait: do you try to run the script within the container? It is not designed to run inside the container (my guess is it will work, but docker detection works only from the outside). It needs to be run on the host system.

What's the output of

๐ŸฆŽ๐Ÿ–ฅ  โœ” ~/dev/docker-pi-hole/etc-pihole [master|โœš 1โ€ฆ7]
21:22 $ command -v docker
/usr/bin/docker
๐ŸฆŽ๐Ÿ–ฅ  โœ” ~/dev/docker-pi-hole/etc-pihole [master|โœš 1โ€ฆ7]
21:22 $ docker ps -q -f status="running" -f name="pihole"
e7f0ac55094f
๐ŸฆŽ๐Ÿ–ฅ  โœ” ~/dev/docker-pi-hole/etc-pihole [master|โœš 1โ€ฆ7]
21:22 $ docker ps -f "name=pihole" -q
e7f0ac55094f

It is not designed to run inside the container

Ok, that explains everything ๐Ÿ˜†

๐ŸฆŽ๐Ÿ–ฅ  โœ” ~/dev/docker-pi-hole/etc-pihole [master|โœš 1โ€ฆ7]
21:24 $ ./pihole_adlist_tool -d 7 -t 100 -r -u


  *** Pihole Adlist Tool 2.6 ***


   ++++++++ Info ++++++++

  [i]  PIHOLE_DOCKER: Yes
โ€ฆ

Butโ€ฆ outside my docker container it works much worse ๐Ÿ˜ข
./pihole_adlist_tool: line 987: pihole-FTL: command not found (repeated many hundred times!)

YMMV - for me it works perfectly ๐Ÿ’‹ ๐Ÿ˜†

I can confirm that it's running fine from within the Docker-container even better than from outside the container.