Search code examples
linuxshellraspberry-pigradlewautostart

How can I add flags included in a shell script?


I want to put myScript.sh on autostart.

I have set the configuration.

chmod +x /etc/init.d/myScript.sh

And enable it

sudo update-rc.d /etc/init.d/myScript.sh defaults

But when I run the myScript.sh I get an error because of the flag -bootRun. myScript.sh looks like this:

sudo /home/pi/path/to/my/program/gradlew -bootRun

How can I run this script instead?

Edit:

I listen to that guy below. I place my code at the rc.local at /etc in Raspberry.

enter image description here

But when I run I ge this error. Why?

enter image description here

enter image description here

enter image description here


Solution

  • Here is the solution. Thanks to theotherguy above!

    enter image description here