jpgpi250 / piholemanual

files referred to in my pihole installation manual
114 stars 14 forks source link

NextDNS.sh and AdguardTeam.sh issues #19

Closed jrschat closed 2 years ago

jrschat commented 2 years ago

Had to rebuild one of my pi's that I use for Pi-Hole today and went to grab the latest versions of these scripts.

Upon running them I receive the following:

sh NextDNS.sh NextDNS.sh: 21: [[: not found --2022-08-19 12:23:01-- https://raw.githubusercontent.com/nextdns/cname-cloaking-blocklist/master/domains Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.111.133, 185.199.110.133, 185.199.108.133, ... Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.111.133|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 2250 (2.2K) [text/plain] Saving to: ‘/home/pi/domains’

/home/pi/domains 100%[=========================================================================>] 2.20K --.-KB/s in 0.001s

2022-08-19 12:23:01 (1.72 MB/s) - ‘/home/pi/domains’ saved [2250/2250]

NextDNS.sh: 34: Syntax error: "(" unexpected (expecting "fi")

and

sh AdguardTeam.sh AdguardTeam.sh: 24: [[: not found --2022-08-19 12:21:21-- https://raw.githubusercontent.com/AdguardTeam/cname-trackers/master/script/src/cloaked-trackers.json Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.110.133, 185.199.108.133, 185.199.109.133, ... Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.110.133|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 4568 (4.5K) [text/plain] Saving to: ‘/home/pi/cloaked-trackers.json’

/home/pi/cloaked-trackers.json 100%[=========================================================================>] 4.46K --.-KB/s in 0.002s

2022-08-19 12:21:22 (1.94 MB/s) - ‘/home/pi/cloaked-trackers.json’ saved [4568/4568]

AdguardTeam.sh: 40: Syntax error: "(" unexpected (expecting "done")

Any ideas?

jpgpi250 commented 2 years ago

For some reason, I only got notified today, thus sorry for the delay.

both your scripts fail because you are running them with sh sh NextDNS.sh sh AdguardTeam.sh

don't know what OS you are running this on, I use latest raspbian, as recommended in the manual.

since they are both bash scripts (first line = #!/bin/bash) you need to run them as such. my bash version: GNU bash, version 5.1.4(1)-release (bash --version)

since you are writing (add entries to the db) you need to run (this is all clearly explained in the manual), assuming you downloaded the scripts in the current directory: sudo ./NextDNS.sh sudo ./AdguardTeam.sh

to ensure it works, I ran both scripts again today, both work as expected.

jrschat commented 2 years ago

Doh, I think I remember this from when I set it up the last time. I think what happens is the bash scripts I tend to write are she’ll compliant and will run as shell. I originally ran them with “sudo” and had the same result. Running them as bash corrects the problem and they now run correctly.