View Single Post
Posts: 277 | Thanked: 319 times | Joined on Jan 2010
#947
Ok, this is driving me nuts. I finally understood how to write a simple script (never done one before) to check a value in a text file and wget my server rewriting that file. This works in terminal, but for some reason, not in QBW. The wget is never sent.

PHP Code:
#!/bin/sh

state=$(awk '{ FS = "~" } ; /Ruokapöytä/{print $4}' zwave.txt)
if [ 
"$state== "0" ]; then 
wget 
-Ozwave.txt 'http://ipaddress:port/ZwaveCommand?command=device&id=22&level=99'
exit 0
else
wget -Ozwave.txt 'http://ipaddress:port/ZwaveCommand?command=device&id=22&level=0'
exit 1
fi

What am I doing wrong?

Any help would be appreciated.

P.S. Is there some way to enable/disable a set alarm in a script?

Last edited by slarti; 2010-11-22 at 12:39.