From 2ba350984f19165b2f224d4d9d7e9bc3bf655850 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 18 Apr 2021 15:12:01 +0200 Subject: [PATCH 01/16] Enable PHP8 support for Debian/Ubuntu Since PHP8.0, the JSON extension is a core PHP extension and hence the php8.0-json package does not exist and is not required: - https://www.php.net/manual/json.installation.php - https://packages.debian.org/php8.0-json Solves: https://discourse.pi-hole.net/t/php-8-packages-not-found/46286 Signed-off-by: MichaIng --- automated install/basic-install.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index eb52aea3..1d6253a0 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -360,7 +360,11 @@ if is_command apt-get ; then PIHOLE_DEPS=(cron curl iputils-ping lsof netcat psmisc sudo unzip wget idn2 sqlite3 libcap2-bin dns-root-data libcap2) # Packages required for the Web admin interface (stored as an array) # It's useful to separate this from Pi-hole, since the two repos are also setup separately - PIHOLE_WEB_DEPS=(lighttpd "${phpVer}-common" "${phpVer}-cgi" "${phpVer}-${phpSqlite}" "${phpVer}-xml" "${phpVer}-json" "${phpVer}-intl") + PIHOLE_WEB_DEPS=(lighttpd "${phpVer}-common" "${phpVer}-cgi" "${phpVer}-${phpSqlite}" "${phpVer}-xml" "${phpVer}-intl") + # Prior to PHP8.0, JSON functionality is provided as dedicated module, required by Pi-hole AdminLTE: https://www.php.net/manual/json.installation.php + if [[ "${phpInsNewer}" != true || "${phpInsMajor}" -lt 8 ]]; then + PIHOLE_WEB_DEPS+=("${phpVer}-json") + fi # The Web server user, LIGHTTPD_USER="www-data" # group, From 5895690b588e0c26efe509f36e455b430fbe3db3 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Sat, 24 Apr 2021 15:38:27 +0100 Subject: [PATCH 02/16] this has been annoying me for months Signed-off-by: Adam Warner --- advanced/Scripts/version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/advanced/Scripts/version.sh b/advanced/Scripts/version.sh index f77ee635..86ac45bc 100755 --- a/advanced/Scripts/version.sh +++ b/advanced/Scripts/version.sh @@ -153,7 +153,7 @@ versionOutput() { if [[ -n "$current" ]] && [[ -n "$latest" ]]; then output="${1^} version is $branch$current (Latest: $latest)" elif [[ -n "$current" ]] && [[ -z "$latest" ]]; then - output="Current ${1^} version is $branch$current." + output="Current ${1^} version is $branch$current" elif [[ -z "$current" ]] && [[ -n "$latest" ]]; then output="Latest ${1^} version is $latest" elif [[ "$curHash" == "N/A" ]] || [[ "$latHash" == "N/A" ]]; then From f3ceebbe06217cac68720d3668b210a0a35f900b Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 30 Apr 2021 20:48:12 +0200 Subject: [PATCH 03/16] Re-remove wget from dependencies The dependency has been removed here: https://github.com/pi-hole/pi-hole/pull/3185 But accidentally re-added here: https://github.com/pi-hole/pi-hole/commit/982c1b0059723e92fa6d6bc92d466d4f2b4f8b8d#diff-595630a29a855f6d667a84ca0662042e826bf3ec56322ef61d4a6ef149147d23 wget is still not used in any Pi-hole script, hence it can be removed safely from dependencies. Signed-off-by: MichaIng --- automated install/basic-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 1d6253a0..454daee4 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -357,7 +357,7 @@ if is_command apt-get ; then # Packages required to run this install script (stored as an array) INSTALLER_DEPS=(dhcpcd5 git "${iproute_pkg}" whiptail dnsutils) # Packages required to run Pi-hole (stored as an array) - PIHOLE_DEPS=(cron curl iputils-ping lsof netcat psmisc sudo unzip wget idn2 sqlite3 libcap2-bin dns-root-data libcap2) + PIHOLE_DEPS=(cron curl iputils-ping lsof netcat psmisc sudo unzip idn2 sqlite3 libcap2-bin dns-root-data libcap2) # Packages required for the Web admin interface (stored as an array) # It's useful to separate this from Pi-hole, since the two repos are also setup separately PIHOLE_WEB_DEPS=(lighttpd "${phpVer}-common" "${phpVer}-cgi" "${phpVer}-${phpSqlite}" "${phpVer}-xml" "${phpVer}-intl") From c9014436767251bd3b67558561afae60d78ee9b3 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 2 May 2021 13:27:35 +0200 Subject: [PATCH 04/16] Remove false statement about dependency removal on Raspbian The statement "All dependencies are safe to remove on Raspbian" has been added at a time where a much smaller list of dependencies were installed, all indeed relatively safe to purge. Nowadays this list has grown and includes important system packages, like iproute2, psmisc, sudo, curl and others, which are often again dependencies of other packages, like network stacks (ifupdown) and others, so that inexperienced users, following that statement, may break their systems network capabilities and more. This message has hence been removed. Signed-off-by: MichaIng --- automated install/uninstall.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/automated install/uninstall.sh b/automated install/uninstall.sh index a0d3b108..543ca07a 100755 --- a/automated install/uninstall.sh +++ b/automated install/uninstall.sh @@ -206,11 +206,7 @@ removeNoPurge() { } ######### SCRIPT ########### -if command -v vcgencmd &> /dev/null; then - echo -e " ${INFO} All dependencies are safe to remove on Raspbian" -else - echo -e " ${INFO} Be sure to confirm if any dependencies should not be removed" -fi +echo -e " ${INFO} Be sure to confirm if any dependencies should not be removed" while true; do echo -e " ${INFO} ${COL_YELLOW}The following dependencies may have been added by the Pi-hole install:" echo -n " " From 6f60555f7994c0e33e5156f8eeadf3469338de25 Mon Sep 17 00:00:00 2001 From: Ashutosh Verma Date: Thu, 20 May 2021 22:34:19 +0530 Subject: [PATCH 05/16] Added install Method 3 Signed-off-by: Ashutosh Verma --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 57dee16d..06f541f4 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,8 @@ sudo bash basic-install.sh wget -O basic-install.sh https://install.pi-hole.net sudo bash basic-install.sh ``` +### Method 3: Using Docker to deploy Pi-hole +Please refer to the [Pi-hole docker repo](https://github.com/pi-hole/docker-pi-hole) to use the Official Docker Images. ## [Post-install: Make your network take advantage of Pi-hole](https://docs.pi-hole.net/main/post-install/) From a9e761ec1336284108baf12e908a2124059cef9f Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sun, 23 May 2021 12:11:04 +0200 Subject: [PATCH 06/16] Add missing sed anchors when deleting lines. Signed-off-by: DL6ER --- advanced/Scripts/webpage.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/advanced/Scripts/webpage.sh b/advanced/Scripts/webpage.sh index 8ef4d940..315236a3 100755 --- a/advanced/Scripts/webpage.sh +++ b/advanced/Scripts/webpage.sh @@ -716,7 +716,7 @@ RemoveCustomDNSAddress() { host="${args[3]}" if valid_ip "${ip}" || valid_ip6 "${ip}" ; then - sed -i "/${ip} ${host}/d" "${dnscustomfile}" + sed -i "/^${ip} ${host}$/d" "${dnscustomfile}" else echo -e " ${CROSS} Invalid IP has been passed" exit 1 @@ -748,7 +748,7 @@ RemoveCustomCNAMERecord() { if [[ -n "${validDomain}" ]]; then validTarget="$(checkDomain "${target}")" if [[ -n "${validDomain}" ]]; then - sed -i "/cname=${validDomain},${validTarget}/d" "${dnscustomcnamefile}" + sed -i "/cname=${validDomain},${validTarget}$/d" "${dnscustomcnamefile}" else echo " ${CROSS} Invalid Target Passed!" exit 1 From 01c310a78f41b84e77283daae87244cb47f5ff4a Mon Sep 17 00:00:00 2001 From: William Horning Date: Thu, 10 Jun 2021 19:23:58 -0400 Subject: [PATCH 07/16] Fix typo Signed-off-by: William Horning --- manpages/pihole.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manpages/pihole.8 b/manpages/pihole.8 index 4ba0e0f7..aaaa8d7e 100644 --- a/manpages/pihole.8 +++ b/manpages/pihole.8 @@ -56,7 +56,7 @@ Available commands and options: \fB-w, whitelist\fR [options] [ ] .br - Adds or removes specified domain or domains tho the Whitelist + Adds or removes specified domain or domains to the Whitelist .br \fB-b, blacklist\fR [options] [ ] From a2d5b8050af46b7f28eff0dfb6b3b81b2c499db9 Mon Sep 17 00:00:00 2001 From: jpgpi250 Date: Mon, 14 Jun 2021 20:27:10 +0200 Subject: [PATCH 08/16] Update gravity.sh Signed-off-by: jpgpi250 --- gravity.sh | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/gravity.sh b/gravity.sh index 24a41c48..7ba443d8 100755 --- a/gravity.sh +++ b/gravity.sh @@ -73,6 +73,8 @@ fi # have changed gravityDBfile="${GRAVITYDB}" gravityTEMPfile="${GRAVITYDB}_temp" +gravityDIR="$(dirname -- "${gravityDBfile}")" +gravityOLDfile="${gravityDIR}/gravity_old.db" if [[ -z "${BLOCKINGMODE}" ]] ; then BLOCKINGMODE="NULL" @@ -123,8 +125,19 @@ gravity_swap_databases() { fi echo -e "${OVER} ${TICK} ${str}" - # Swap databases and remove old database - rm "${gravityDBfile}" + # Swap databases and remove or conditionally rename old database + # Number of available blocks on disk + availableBlocks=$(stat -f --format "%a" "${gravityDIR}") + # Number of blocks, used by gravity.db + gravityBlocks=$(stat --format "%b" ${gravityDBfile}) + # Only keep the old database if available disk space is at least twice the size of the existing gravity.db. + # Better be safe than sorry... + if [ "${availableBlocks}" -gt "$(("${gravityBlocks}" * 2))" ] && [ -f "${gravityDBfile}" ]; then + echo -e " ${TICK} The old database remains available." + mv "${gravityDBfile}" "${gravityOLDfile}" + else + rm "${gravityDBfile}" + fi mv "${gravityTEMPfile}" "${gravityDBfile}" } @@ -890,6 +903,11 @@ for var in "$@"; do esac done +# Remove OLD (backup) gravity file, if it exists +if [[ -f "${gravityOLDfile}" ]]; then + rm "${gravityOLDfile}" +fi + # Trap Ctrl-C gravity_Trap From 01764cc581220fb1751ebcb8808d5ca59ec7d2d6 Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Sun, 20 Jun 2021 10:28:25 -0700 Subject: [PATCH 09/16] Explicity declare values for the RA packet. Signed-off-by: Dan Schaper --- advanced/Scripts/webpage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/advanced/Scripts/webpage.sh b/advanced/Scripts/webpage.sh index 8ef4d940..32719eb2 100755 --- a/advanced/Scripts/webpage.sh +++ b/advanced/Scripts/webpage.sh @@ -426,7 +426,7 @@ dhcp-leasefile=/etc/pihole/dhcp.leases echo "#quiet-dhcp6 #enable-ra dhcp-option=option6:dns-server,[::] -dhcp-range=::100,::1ff,constructor:${interface},ra-names,slaac,${leasetime} +dhcp-range=::100,::1ff,constructor:${interface},ra-names,slaac,64,3600 ra-param=*,0,0 " >> "${dhcpconfig}" fi From 7df22cd8e035d64bf6d46397dbf3680395222776 Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Sun, 20 Jun 2021 11:18:33 -0700 Subject: [PATCH 10/16] Check for logroate script existing first. Signed-off-by: Dan Schaper --- automated install/basic-install.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 454daee4..73b456ca 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -1944,9 +1944,17 @@ finalExports() { # Install the logrotate script installLogrotate() { local str="Installing latest logrotate script" + local target=/etc/pihole/logrotate + printf "\\n %b %s..." "${INFO}" "${str}" + if [[ -f ${target} ]]; then + printf "\\n\\t%b Existing logrotate file found. No changes made.\\n" "${INFO}" + # Return value isn't that important, using 2 to indicate that it's not a fatal error but + # the function did not complete. + return 2 + fi # Copy the file over from the local repo - install -D -m 644 -T ${PI_HOLE_LOCAL_REPO}/advanced/Templates/logrotate /etc/pihole/logrotate + install -D -m 644 -T ${PI_HOLE_LOCAL_REPO}/advanced/Templates/logrotate ${target} # Different operating systems have different user / group # settings for logrotate that makes it impossible to create # a static logrotate file that will work with e.g. @@ -1957,7 +1965,7 @@ installLogrotate() { # If there is a usergroup for log rotation, if [[ ! -z "${logusergroup}" ]]; then # replace the line in the logrotate script with that usergroup. - sed -i "s/# su #/su ${logusergroup}/g;" /etc/pihole/logrotate + sed -i "s/# su #/su ${logusergroup}/g;" ${target} fi printf "%b %b %s\\n" "${OVER}" "${TICK}" "${str}" } From 4f660966d036a562d1fbbadbe0d56b52fa6cbf5b Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Sun, 20 Jun 2021 11:19:19 -0700 Subject: [PATCH 11/16] Shellchecker Signed-off-by: Dan Schaper --- automated install/basic-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 73b456ca..96ca8c92 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -1954,7 +1954,7 @@ installLogrotate() { return 2 fi # Copy the file over from the local repo - install -D -m 644 -T ${PI_HOLE_LOCAL_REPO}/advanced/Templates/logrotate ${target} + install -D -m 644 -T "${PI_HOLE_LOCAL_REPO}"/advanced/Templates/logrotate ${target} # Different operating systems have different user / group # settings for logrotate that makes it impossible to create # a static logrotate file that will work with e.g. @@ -1963,7 +1963,7 @@ installLogrotate() { # the local properties of the /var/log directory logusergroup="$(stat -c '%U %G' /var/log)" # If there is a usergroup for log rotation, - if [[ ! -z "${logusergroup}" ]]; then + if [[ -n "${logusergroup}" ]]; then # replace the line in the logrotate script with that usergroup. sed -i "s/# su #/su ${logusergroup}/g;" ${target} fi From 2b499880133c2869313d1a8ce971d3be86c6ae81 Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 1 Jul 2021 02:19:00 +0000 Subject: [PATCH 12/16] Include lighttpd-mod-deflate in the PIHOLE_WEB_DEPS list since it is no longer provided by default in Debian Bullseye Signed-off-by: Daniel --- automated install/basic-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 96ca8c92..17462c73 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -360,7 +360,7 @@ if is_command apt-get ; then PIHOLE_DEPS=(cron curl iputils-ping lsof netcat psmisc sudo unzip idn2 sqlite3 libcap2-bin dns-root-data libcap2) # Packages required for the Web admin interface (stored as an array) # It's useful to separate this from Pi-hole, since the two repos are also setup separately - PIHOLE_WEB_DEPS=(lighttpd "${phpVer}-common" "${phpVer}-cgi" "${phpVer}-${phpSqlite}" "${phpVer}-xml" "${phpVer}-intl") + PIHOLE_WEB_DEPS=(lighttpd lighttpd-mod-deflate "${phpVer}-common" "${phpVer}-cgi" "${phpVer}-${phpSqlite}" "${phpVer}-xml" "${phpVer}-intl") # Prior to PHP8.0, JSON functionality is provided as dedicated module, required by Pi-hole AdminLTE: https://www.php.net/manual/json.installation.php if [[ "${phpInsNewer}" != true || "${phpInsMajor}" -lt 8 ]]; then PIHOLE_WEB_DEPS+=("${phpVer}-json") From c120f8a8d88a20dd9bb5905ae3cf5a5f3ddb9466 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Fri, 2 Jul 2021 22:09:41 +0100 Subject: [PATCH 13/16] Revert "Include lighttpd-mod-deflate since it is no longer provided by default in Bullsye" --- automated install/basic-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 17462c73..96ca8c92 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -360,7 +360,7 @@ if is_command apt-get ; then PIHOLE_DEPS=(cron curl iputils-ping lsof netcat psmisc sudo unzip idn2 sqlite3 libcap2-bin dns-root-data libcap2) # Packages required for the Web admin interface (stored as an array) # It's useful to separate this from Pi-hole, since the two repos are also setup separately - PIHOLE_WEB_DEPS=(lighttpd lighttpd-mod-deflate "${phpVer}-common" "${phpVer}-cgi" "${phpVer}-${phpSqlite}" "${phpVer}-xml" "${phpVer}-intl") + PIHOLE_WEB_DEPS=(lighttpd "${phpVer}-common" "${phpVer}-cgi" "${phpVer}-${phpSqlite}" "${phpVer}-xml" "${phpVer}-intl") # Prior to PHP8.0, JSON functionality is provided as dedicated module, required by Pi-hole AdminLTE: https://www.php.net/manual/json.installation.php if [[ "${phpInsNewer}" != true || "${phpInsMajor}" -lt 8 ]]; then PIHOLE_WEB_DEPS+=("${phpVer}-json") From 469b71544262f8473cc1e22142ee01a4016785fc Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Sat, 3 Jul 2021 00:00:54 +0100 Subject: [PATCH 14/16] Add three new tests (one for each dependecy array) to check packages are available in supported OS package repos Signed-off-by: Adam Warner --- test/test_automated_install.py | 40 ++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/test/test_automated_install.py b/test/test_automated_install.py index 44624082..891fc185 100644 --- a/test/test_automated_install.py +++ b/test/test_automated_install.py @@ -597,3 +597,43 @@ def test_os_check_passes(Pihole): ''') expected_stdout = 'Supported OS detected' assert expected_stdout in detectOS.stdout + + +def test_package_manager_has_installer_deps(Pihole): + ''' Confirms OS is able to install the required packages for the installer''' + mock_command('whiptail', {'*': ('', '0')}, Pihole) + output = Pihole.run(''' + source /opt/pihole/basic-install.sh + distro_check + install_dependent_packages ${INSTALLER_DEPS[@]} + ''') + + assert 'No package' not in output.stdout #centos7 still exits 0... + assert output.rc == 0 + + +def test_package_manager_has_pihole_deps(Pihole): + ''' Confirms OS is able to install the required packages for Pi-hole ''' + mock_command('whiptail', {'*': ('', '0')}, Pihole) + output = Pihole.run(''' + source /opt/pihole/basic-install.sh + distro_check + install_dependent_packages ${PIHOLE_DEPS[@]} + ''') + + assert 'No package' not in output.stdout #centos7 still exits 0... + assert output.rc == 0 + + +def test_package_manager_has_web_deps(Pihole): + ''' Confirms OS is able to install the required packages for web ''' + mock_command('whiptail', {'*': ('', '0')}, Pihole) + output = Pihole.run(''' + source /opt/pihole/basic-install.sh + distro_check + install_dependent_packages ${PIHOLE_WEB_DEPS[@]} + ''') + + assert 'No package' not in output.stdout #centos7 still exits 0... + assert output.rc == 0 + From 87f2ae82cd16473886c4bf9da1d9d19fb909aa1a Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Sat, 3 Jul 2021 00:07:37 +0100 Subject: [PATCH 15/16] Stickler gonna stickle... Signed-off-by: Adam Warner --- test/test_automated_install.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/test_automated_install.py b/test/test_automated_install.py index 891fc185..0849aa9a 100644 --- a/test/test_automated_install.py +++ b/test/test_automated_install.py @@ -608,7 +608,7 @@ def test_package_manager_has_installer_deps(Pihole): install_dependent_packages ${INSTALLER_DEPS[@]} ''') - assert 'No package' not in output.stdout #centos7 still exits 0... + assert 'No package' not in output.stdout # centos7 still exits 0... assert output.rc == 0 @@ -621,7 +621,7 @@ def test_package_manager_has_pihole_deps(Pihole): install_dependent_packages ${PIHOLE_DEPS[@]} ''') - assert 'No package' not in output.stdout #centos7 still exits 0... + assert 'No package' not in output.stdout # centos7 still exits 0... assert output.rc == 0 @@ -634,6 +634,5 @@ def test_package_manager_has_web_deps(Pihole): install_dependent_packages ${PIHOLE_WEB_DEPS[@]} ''') - assert 'No package' not in output.stdout #centos7 still exits 0... + assert 'No package' not in output.stdout # centos7 still exits 0... assert output.rc == 0 - From 4fb5157719f3f8c74e9dfb9e8167673c96947532 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Fri, 4 Jun 2021 21:59:17 +0200 Subject: [PATCH 16/16] Squashed commits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add simple grep function to pihole -t Signed-off-by: Christian König Add help info Signed-off-by: Christian König Improve help info Signed-off-by: Christian König Fix details Signed-off-by: Christian König --- pihole | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pihole b/pihole index f8085c8e..58ec385a 100755 --- a/pihole +++ b/pihole @@ -370,7 +370,7 @@ tailFunc() { # Color blocklist/blacklist/wildcard entries as red # Color A/AAAA/DHCP strings as white # Color everything else as gray - tail -f /var/log/pihole.log | sed -E \ + tail -f /var/log/pihole.log | grep --line-buffered "${1}" | sed -E \ -e "s,($(date +'%b %d ')| dnsmasq\[[0-9]*\]),,g" \ -e "s,(.*(blacklisted |gravity blocked ).* is (0.0.0.0|::|NXDOMAIN|${IPV4_ADDRESS%/*}|${IPV6_ADDRESS:-NULL}).*),${COL_RED}&${COL_NC}," \ -e "s,.*(query\\[A|DHCP).*,${COL_NC}&${COL_NC}," \ @@ -456,7 +456,10 @@ Debugging Options: Add '-a' to automatically upload the log to tricorder.pi-hole.net -f, flush Flush the Pi-hole log -r, reconfigure Reconfigure or Repair Pi-hole subsystems - -t, tail View the live output of the Pi-hole log + -t, tail [arg] View the live output of the Pi-hole log. + Add an optional argument to filter the log + (regular expressions are supported) + Options: -a, admin Web interface options @@ -530,7 +533,7 @@ case "${1}" in "status" ) statusFunc "$2";; "restartdns" ) restartDNS "$2";; "-a" | "admin" ) webpageFunc "$@";; - "-t" | "tail" ) tailFunc;; + "-t" | "tail" ) tailFunc "$2";; "checkout" ) piholeCheckoutFunc "$@";; "tricorder" ) tricorderFunc;; "updatechecker" ) updateCheckFunc "$@";;