From 3b229489c2f4aca05637eef674d5e8c116dbf373 Mon Sep 17 00:00:00 2001 From: Ludovic Rousseau Date: Fri, 13 Apr 2018 09:19:31 +0200 Subject: [PATCH] Fix regex to find DBFILE= from configuration file The regex ^\s^.DBFILE\s*=\s* does not work to match "DBFILE=" I don't know what the second '^' is used for. With the change I now have the results: DBFILE=/foo/bar -> /foo/bar DBFILE=/foo/bar -> /foo/bar # DBFILE=/foo/bar -> /etc/pihole/pihole-FTL.db xDBFILE=/foo/bar -> /etc/pihole/pihole-FTL.db Signed-off-by: Ludovic Rousseau --- advanced/Scripts/piholeLogFlush.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/advanced/Scripts/piholeLogFlush.sh b/advanced/Scripts/piholeLogFlush.sh index 5fd9832e..ffc9e0f5 100755 --- a/advanced/Scripts/piholeLogFlush.sh +++ b/advanced/Scripts/piholeLogFlush.sh @@ -16,7 +16,7 @@ source ${colfile} # Constructed to return nothing when # a) the setting is not present in the config file, or # b) the setting is commented out (e.g. "#DBFILE=...") -DBFILE="$(sed -n -e 's/^\s^.DBFILE\s*=\s*//p' /etc/pihole/pihole-FTL.conf)" +DBFILE="$(sed -n -e 's/^\s*DBFILE\s*=\s*//p' /etc/pihole/pihole-FTL.conf)" # Test for empty string. Use standard path in this case. if [ -z "$DBFILE" ]; then DBFILE="/etc/pihole/pihole-FTL.db"