Wiki useful shell scripts not so useful

  • Hi all.


    Somebody a while back pointed me in the direction of useful shell scripts wiki for wanting to wake and sleep my computer running libreelec.


    Im having a hard time trying to get it working correctly.


    I have created a prevent_idle_shutdown.sh file in the config directory containing the scripts from here Useful shell scripts [LibreELEC.wiki]


    I have then added what I need to to the autostart.sh file


    After that I have ran chmod +x on both files to make sure the executable and rebooted.


    Then running my pi over samba shares this will prevent my computer from going to sleep, and when stopping the media on the pi the main computer will go to sleep.


    My problem is that the next time the computer wakes it will not sleep after the time I have set, it's almost like the script is keeping it awake even though nothing is connecting to it, so basically it only works once.


    Anybody know anything about this.


    Thanks

  • Untested, but try this variant:

    Beast Mode

  • Thanks will give this a try tomorrow when I get a spare half hour.


    Im wondering if it might be something to do with the autostart script to be honest.


    The fact it works with a reboot, and works if I power it of then on again, but when it sleeps then wakes that's when it no longer works.


    I'll try the above script and let you know.


    Thanks

  • Hi, I've managed to solve this.

    It was indeed my autostart.sh file


    Using the script from the wiki for the prevent idle shutdown works fine.


    Ive added stuff to the autostart.sh in the past and though I knew what I was doing lol.


    Looking at the wiki for autostart it became clear I needed to use the nohup command to keed the script running.


    Thanks again for the help suppose I just needed a little extra time on this to solve it.


    Rob