Cron daemon cannot find the LE network tools

  • Hi,

    I have a shell script that uses "sshpass" command from the LE network tools addon.
    When I start the script manually from a ssh-terminal it works fine.
    When the script is scheduled and started from the cron daemon it cannot find the "sshpass" command.
    The command is located in the directory /storage/.kodi/addons/virtual.network-tools/bin.
    I noticed that the PATH environment variable in ssh-terminal is different then in cron daemon, and the latter does not contain the bin-dir of the addon. See below.
    Where in LE is the PATH environment variable being set?
    How can I update the PATH environment variable of the cron daemon jobs?
    Thanks.


    PATH when using ssh-terminal:
    -------------------------------------------
    /usr/bin:/usr/sbin:/storage/.kodi/addons/browser.chrome/bin:/storage/.kodi/addons/tools.flirc_util/bin:/storage/.kodi/addons/virtual.network-tools/bin:/storage/.kodi/addons/virtual.system-tools/bin

    PATH when using cron daemon:
    --------------------------------------------
    /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin

  • cron doesn't run in the root user environment so $PATH is different and you should always use the /full/path/to/binary with any commands you run instead of assuming binaries are available in path.