Hi,
Ive got the following simple bash script that reads a file, subtracts 10 from the number, writes file back out then executes a curl command to control my amp.
The script is
#!/bin/bash
counter_file="counter.tmp"
read -d $'\x04' count < "counter_file"
count=$((count-10))
echo $count > $counter_file
curl ......
If i execute this from the command line with ./volumeup.sh it works fine but when i try with the on action on a switch it doesnt work?.
If i dont do any file reading and just set the count variable to say count=300 then the script works in domoticz.
Ive tried different methods to read the file, ie cat but none of them work when the script is executed in domoticz, all work fine on the command line.
Any ideas?.
Thanks.
Bash script working via command line but not via Domoticz
Moderator: leecollings
Re: Bash script working via command line but not via Domoticz
What an idiot.!!!!
Im new to all this and just had a brain wave, needed to include the path to my counter.tmp file. /home/pi/domoticz/scripts
Now works fine
Im new to all this and just had a brain wave, needed to include the path to my counter.tmp file. /home/pi/domoticz/scripts
Now works fine

Who is online
Users browsing this forum: No registered users and 1 guest