1

I'm a novice with linux or any command line, but I've managed to gain root access to my Buffalo Terastation (TS-HTGL/R5) and install noip & mediatomb.

The problem I have is that I can't get noip2 to automatically start, but I figured out what to do for mediatomb (using a guide). I have the following script in /opt/etc/init.d/S90noip2 but I get the error bad interpreter: no such file or directory

#! /bin/sh
case "$1" in
    start)
    echo "Starting noip2."
    /opt/bin/noip2
    ;;
    stop)
    echo -n "Shutting down noip2."
    killall noip2
    ;;
    *)
    echo "Usage: $0 {start|stop}"
    exit 1
esac
exit 0
Blease
  • 1,380
  • 4
  • 38
  • 64
  • 1
    Perhaps you do not have `/bin/sh`? Check that `/bin/sh` exists. Also, it seems that there is space between `!` and `/bin/sh`. Although this shouldn't cause problems you can try it as well. And finally, make sure there is no carriage return at the end of `#!/bin/sh` which is likely to happen if you uploaded the script from Windows (useful info [here](http://stackoverflow.com/questions/3860519/see-line-breaks-and-carriage-returns-in-editor)). – VolenD Feb 01 '15 at 11:06
  • Are you following [this tutorial](https://www.howtoforge.com/how-to-install-no-ip2-on-ubuntu-12.04-lts-in-order-to-host-servers-on-a-dynamic-ip-address)? – mertyildiran Feb 02 '15 at 04:30

1 Answers1

0

I would try the following things:

  1. Remove space between #! and /bin/bash in the first line. You should have: #!/bin/bash

  2. Make the file is executable: chmod +x /opt/etc/init.d/S90noip2

  3. Check that /opt/bin/noip2 actually exists.

  4. Try running /opt/bin/noip2 by hand to see if it works.

  5. If none of the above steps helped, post your results here, so we can figure out further steps.

  6. If your problem is solved, accept this answer and click up vote button. :)

PS: And don't forget the bounty. :D

  • I managed to fix it before seeing your answer! I just slipped `/opt/bin/noip2` into the rc.optware file before any other init code. A little naughty, but I will use your advice as future reference, cheers! You got the bounty as it will be useful for other scripts :) – Blease Feb 07 '15 at 13:48
  • I have just tried your method and also rewrote the script using the vi editor and it works! Thanks for the help, you definitely deserve the bounty – Blease Feb 07 '15 at 14:43