The script runs fine from a bash terminal and also when called by cron there is no problem. It's not the contents of the script, any script tried so far gives the same result. I read a lot of action on problems on the forum which gave me a lot of insight but none of them solves my problem. Since the error codes are consistent for all tried scripts there must be something I am overlooking. There are other ways to get this done, the original cpu temp script runs fine using cron, but I want to understand why action on script:// is not working.
This is a simple script that produces the same result.
Code: Select all
#!/bin/bash
echo "hello" >> /home/pi/domoticz/scripts/bash/test.log &
Code: Select all
/home/pi/domoticz/scripts/bash/tems2.sh
In the domoticz web interface it is configured in the on action of a switch.
Code: Select all
script:///home/pi/domoticz/scripts/bash/tems2.sh
Code: Select all
2016-05-04 12:38:58.899 User: Admin initiated a switch command
2016-05-04 12:38:58.901 (RFXtrx433 ) Lighting 2 (Schemerlamp Tafel)
2016-05-04 12:38:59.149 Executing script: /home/pi/domoticz/scripts/bash/tems2.sh
2016-05-04 12:38:59.149 Error: Error executing script command (/home/pi/domoticz/scripts/bash/tems2.sh). returned: -1