Im trying to set up an automation which calls a script that again calls a shell command to launch the end point, a .sh file from the file system…
I get the following error when running the script:
download: Error executing script. Unexpected error for call_service at pos 1: [Errno 2] No such file or directory: ‘/scripts/download.sh’
Script Config:
service: shell_command.download
data_template:
movie: ‘{{ movie }}’
Shell Command:
movie: /scripts/download.sh “{{movie}}” 0 (this is the file location referred to in the log)
The download.sh file is located in the following folder on the SD Card:
/root/config/scripts/download.sh
I have tried a number of different paths (/script/, /local/script/, /) but none seem to work…
You may need to put it in the config directory itself, rather than in a subdirectory. You can confirm what the container can access by running ‘docker exec -it homeassistant /bin/bash’ from ssh and see for yourself.
hmm… not sure what I am looking for, but it still does not work… I’ve tried to place the .sh file in both /config and /config/scripts (and amended the shell command accordingly.
Sometimes that error can be misleading, and instead refers to an inability to find the shell that you specify in the script (i.e., #!/bin/bash or whatever - the “shebang”) and not the script itself. For instance, if you had #!/foobar/foo as the first line in your script and that executable doesn’t exist, then you may get a “not found” error, even if it found your script and tried to execute it.
Here’s one of my shell commands for my adjustable bed:
Thanks for trying to help Rob… I’ve finally got it working (after wasting the entire morning)… in the end it was a combination of things… but I now run the command over ssh rather than straight off file system… and I had to add this to the top of the download.sh file: