Bash script working via command line but not via Domoticz
Posted: Friday 24 June 2016 13:45
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.
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.