autostart.sh unexpected behavior

  • I have a remote playlist which I'd like to download, perform a simple search & replace, and save in a local path; the aforementioned steps should be executed on boot.

    The first step is to download and edit the playlist. This can be accomplished with the following command:

    Code
    curl 'remote-playlist-url' | sed 's/.ts/.m4v/g' > /storage/playlist.m3u


    which produce the expected file.

    The second step is to perform the first step on every boot. I have created a /storage/.config/autostart.sh file with the following content:

    Code
    (
     curl 'remote-playlist-url' | sed 's/.ts/.m4v/g' > /storage/playlist.m3u;
    ) &


    However, all I got is an empty file, and I don't know why nor how to debug the command.
    Any hint would be appreciated.

    Edited once, last by phant0mw0rm (April 29, 2017 at 2:54 PM).

  • Network is not yet up. Somewhere in LibreELEC settings enable Wait for network.
    Other option is to add before curl line sleep 5 or even little more time to get network up.


  • Network is not yet up. Somewhere in LibreELEC settings enable Wait for network.
    Other option is to add before curl line sleep 5 or even little more time to get network up.

    Honestly I thought the same, but AFAIK the content of autostart.sh is executed with this daemon, which should wait for the network because of this line:

    Code
    After=network-online.target graphical.target

    Anyway, I'll give it a try as soon as possible, thank you!