autostop.sh

  • Hi,

    I use autostop.sh to shutdown nas, but autostop.sh gets executed on reboot too.

    I'd like to avoid that.

    Is it possible to filter commands from autostop.sh like shown in the wiki for shutdown.sh?

  • Better check whether reboot is running.

    don't know how to do that.


    you can initiate a shutdown script on your NAS with some delay

    good idea, but far from being elegant ...

    So I asked in kodi-forum and a friendly user guided me to his plugin.

    You need to download it as zip-file and install from kodi by "install from zip-file".

    This plugin will create a menu from your command entries, where you can execute a script by menu-selection.

  • Code
    if [ "$(systemctl is-active reboot.target)" = "active" ]; then
      exit 0
    fi

    ^ If reboot.target is active you are rebooting, and exit the script. Untested, but I think should work. An alternative would be to test whether shutdown.target is active and only then proceed.