我如何添加shell脚本中包含的标志?

问题描述 投票:0回答:1

我想将myScript.sh设置为自动启动。

我已经设置好配置。

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

并启用它

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

但是当我运行myScript.sh时,由于标志-bootRun,我得到了一个错误。 myScript.sh看起来像这样:

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

我该如何运行此脚本?

编辑:

我听下面那个家伙。我将代码放在Raspberry中rc.local/etc

enter image description here

但是当我跑步时,我会出现此错误。为什么?

enter image description here

enter image description here

enter image description here

linux shell raspberry-pi gradlew autostart
1个回答
0
投票
这里是解决方案。感谢上面的theguy!
© www.soinside.com 2019 - 2024. All rights reserved.