Maddcow / Lancache-Pihole

19 stars 3 forks source link

sudo: unable to execute ./lancache-pihole.sh: No such file or directory #1

Open reg98643t opened 1 year ago

reg98643t commented 1 year ago

Running pihole on docker via unraid.

Maddcow commented 1 year ago

I haven't used unraid but from your description it looks like you are not in the folder that lancache-pihole.sh is located at.

Side note - your post got me thinking about updates to verify docker installs of pihole.

reg98643t commented 1 year ago

I think I am, the line looks like this:

image

ben9923 commented 1 year ago

Seems like lancache-dns-updates.sh and lancache-pihole.sh were commited with CRLF line endings rather than LF, breaking their execution. They may be converted with dos2unix :)

(No idea if the script will work when invoked within a pihole/pihole container after conversion, I believe it won't detect the running service)

Banner-Keith commented 1 year ago

I am also running into this problem

StevenKrahforst commented 1 year ago

Just execute sed -i -e 's/\r$//' *.sh in the cloned folder https://stackoverflow.com/questions/14219092/bash-script-bin-bashm-bad-interpreter-no-such-file-or-directory

Happyrobot33 commented 1 year ago

Seems like lancache-dns-updates.sh and lancache-pihole.sh were commited with CRLF line endings rather than LF, breaking their execution. They may be converted with dos2unix :)

(No idea if the script will work when invoked within a pihole/pihole container after conversion, I believe it won't detect the running service)

this completely works. just use dos2unix on the file before running it

liquidfrollo commented 1 year ago

"(No idea if the script will work when invoked within a pihole/pihole container after conversion, I believe it won't detect the running service)">

It will not as systctl is not found / active (atleast k3s truecharts) but you can use service pihole-FTL status. I'm currently trying to get this working as we speak as i use truecharts and i am running pihole. Getting an error 'cp: cannot stat '/tmp/tmp.x/scripts/output/dnsmasq/*.conf: no such file or directory". It appears that in the create-dnsmasq.sh script has something it doesn't like as it claims parse error: Invalid numeric literal at line 4, column 0

patsandy100 commented 1 year ago

"(No idea if the script will work when invoked within a pihole/pihole container after conversion, I believe it won't detect the running service)">

It will not as systctl is not found / active (atleast k3s truecharts) but you can use service pihole-FTL status. I'm currently trying to get this working as we speak as i use truecharts and i am running pihole. Getting an error 'cp: cannot stat '/tmp/tmp.x/scripts/output/dnsmasq/*.conf: no such file or directory". It appears that in the create-dnsmasq.sh script has something it doesn't like as it claims parse error: Invalid numeric literal at line 4, column 0

Did you get it working? I was trying to work out how to fix this as well.

codygp commented 6 months ago

Just execute sed -i -e 's/\r$//' *.sh in the cloned folder https://stackoverflow.com/questions/14219092/bash-script-bin-bashm-bad-interpreter-no-such-file-or-directory

This worked for me, thanks!