taillog Prevent grep interpeting search term as an option

Adds '--' indicating end of options before the user provided
search pattern.

Signed-off-by: Rob Gill <rrobgill@protonmail.com>
This commit is contained in:
Rob Gill 2025-06-29 06:45:02 +10:00
parent f90677a1ff
commit f24fc9573a
No known key found for this signature in database
GPG Key ID: 625CBEA2C626280D

2
pihole
View File

@ -396,7 +396,7 @@ tailFunc() {
# Color blocklist/denylist/wildcard entries as red
# Color A/AAAA/DHCP strings as white
# Color everything else as gray
tail -f $LOGFILE | grep --line-buffered "${1}" | sed -E \
tail -f $LOGFILE | grep --line-buffered -- "${1}" | sed -E \
-e "s,($(date +'%b %d ')| dnsmasq\[[0-9]*\]),,g" \
-e "s,(.*(denied |gravity blocked ).*),${COL_RED}&${COL_NC}," \
-e "s,.*(query\\[A|DHCP).*,${COL_NC}&${COL_NC}," \