PSS
PSS copied to clipboard
line 48: syntax error near unexpected token
FYI, as of August 27, 2020, the current script 1.6.1 gives this error on a raspberry pi running raspbian buster. Pi-hole v5.1.2
pi@raspberrypi:~ $ sudo Pi-hole_SafeSearch.sh --enable [2020-08-27 14:30:01:998]: Retrieving List from Google [2020-08-27 14:30:03:287]: 191 TLDs [2020-08-27 14:30:03:297]: 382 Domains [2020-08-27 14:30:03:308]: ENABLING SAFESEARCH FOR PI-HOLE [2020-08-27 14:30:03:325]: BLOCKING OTHER BAD SITES /usr/local/bin/Pi-hole_SafeSearch.sh: line 48: syntax error near unexpected token
^'
/usr/local/bin/Pi-hole_SafeSearch.sh: line 48: "(^|\.).+xxx$"'
In testing, it looks like line 192 is the one that is failing. If I comment it out, things work.
silently pihole --regex "${REGEX[@]}"
For clarity, here's what the REGEX code is:
REGEX=( "(^|\.).+xxx$" "(^|\.).+sexy$" "(^|\.).+webcam$" "(^|\.).+sex$" "(^|\.).+porn$" "(^|\.).+tube$" "(^|\.).+cam$" "(^|\.).+adult$" )
The log file has this in it: `pi@raspberrypi:~ $ cat /var/log/Pi-hole_SafeSearch.sh.log [2020-08-27 14:30:01:984]: STARTED [2020-08-27 14:30:01:989]: ARGUMENTS: --enable /usr/local/bin/Pi-hole_SafeSearch.sh: line 118: checkSudo: command not found [2020-08-27 14:30:01:995]: Retrieving List from Google [2020-08-27 14:30:03:282]: 191 TLDs [2020-08-27 14:30:03:292]: 382 Domains [2020-08-27 14:30:03:303]: ENABLING SAFESEARCH FOR PI-HOLE [2020-08-27 14:30:03:320]: BLOCKING OTHER BAD SITES [2020-08-27 14:30:04:083]: STOPPED
`
Sorry for the odd formatting, not sure why it isn't showing the code with the newline/CR.