Bash script working via command line but not via Domoticz

All kinds of 'OS' scripts
Locked
Scoobydoo
Posts: 56
Joined: Tuesday 16 July 2013 12:20
Target OS: -
Domoticz version:
Contact:

Bash script working via command line but not via Domoticz

Post by Scoobydoo » 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.

Scoobydoo
Posts: 56
Joined: Tuesday 16 July 2013 12:20
Target OS: -
Domoticz version:
Contact:

Re: Bash script working via command line but not via Domoticz

Post by Scoobydoo » Friday 24 June 2016 13:51

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 :)

Locked

Who is online

Users browsing this forum: No registered users and 1 guest