I prepared an image and included in
/etc/rc.local a line to run a script:
I then created a script at that location
It contains a curl, to download and save a file as new file to the system. After this the file should be executed.
My problem is the following:
The content of the script I included directly to
rc.local before and got an error
It was the line downloading a scriptfile and save it locally.
Now I started to read further post and all said, it's better to exclude commands to a script file and launch the script file via rc.local only.
But the permissions-problem persists.
So I tried to modify my
/path/to/myscript.sh # not working sudo /path/to/myscript.sh # not working
also in my script I added
sudo to each command, it's not working.
Currently it seems curl with saving a file isn't allowed. (Internet connection exists).
Other posts say I should install a service. Now I think it's going oversized and have no warranty. I need to run the script only once at reboot. In the script I tell the device to download bash-scripts and execute them.
So it seems I have a permission problem and I don't know how to fix it.
Maybe I used the wrong method to run a script after boot.
Why does this problem occur and how to fix ?