0

I have a netgear nighhawk r7000 router with the DD-WRT "Kong Mod" release: 04-19-2016. I was trying to block ads directly on the router with pixelserv following this tutorial (and yes I have set the script to be executable).

Unfortunately it doesn't work.

It is written in the tutorial that saving the command for startup like this /jffs/dns/disable_adds.sh should result in the script beeing run at startup.

When trying to start the script directly like written above via the command shell of the webinterface of the router I get the following message:

sh: eval: line 1: /jffs/dns/disable_adds.sh: not found

Trying an echo $PWD in the mentioned command shell returns /www which is a folder parallel in the hierarchy to /jffs.

Using ls ../jffs/dns in the same shell does show that the script is found where it is supposed to be. Trying to run the script with ../jffs/dns/disable_adds.sh produces the same message as above.

It seems worth noting that the output field sometimes doesn't show anything even with just echo and that more than one command also doesn't seem to work

I have no idea how to proceed now to find out why the router doesn't acknowledge the existance of the script and how to get it to run.

Edit: I guess I should mention that I already tried following the troubleshooting steps at the end of the mentioned tutorial and that I'm trying to get it to work from a pc with windows 7.

Edit2: I formatted the text a bit as was suggested in the comments and added some more information. I hope it is more readable now.

2
  • Welcome to Super User. Common mistake some members make is formatting. Many people will not read a huge bock of difficult to read text. Taking a minute to review formatting, then edit your question to make it easier to read will increase your chances of getting the help you seek.
    – CharlieRB
    Jun 15, 2016 at 16:19
  • 1
    /jffs/dns/ is not the same as ../jffs/dns
    – DavidPostill
    Jun 15, 2016 at 17:35

2 Answers 2

1

I would guess that you've not specified the shebang properly.

When you run a script, this will tell the system how to execute it, try the following examples:

Trying to use /bin/bat as the interpreter (/bin/bat doesn't exist):

$ cat <<EOF >test.sh
> #!/bin/bat
> hello
> EOF
$ chmod +x test.sh
$ ./test.sh
-bash: ./test.sh: /bin/bat: bad interpreter: No such file or directory

Trying to use /bin/cat as the interpreter:

$ cat <<EOF >test.sh
> #!/bin/cat
> hello
> EOF
$ chmod +x test.sh
$ ./test.sh
#!/bin/cat
hello

It's very possible that on a cutdown / embedded system, you'll be presented with the not found error you see above.

Check that you've typed that important first line correctly (#!...), and that the file listed there exists, and can be executed without error.

You will typically want something like #!/bin/sh (as specified in their disable_adds.sh).

Edit: It's also possible that you have a problem with line endings - make sure that WinSCP or whatever you're using to transfer the files doesn't play with them. WinSCP FAQ.

0

I had the same issue. I documented my solution here on my blog, http://studioforge.xyz/how-to-configure-cisco-linksys-wrt54g-v-2-to-run-pixelserv-on-dd-wrt/, it came down to running dos2unix on one of the files and re-uploading.

1
  • 1
    Welcome to Super User! Please edit your post to include the essential elements of the linked material. Good answers include specific instructions (not just links to them) and an explanation as to how/why the answer addresses the OPs question. Jun 6, 2017 at 20:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .