I read that “os.execute” should be used as last resource in a luup script, but I only know a little linux and I usually survive using it in my Vera.
This is the problem I have. I ssh another linux device in my local network and I “cat” one file, where the temperature of the device is stored. Then, I send the output to a file on the Vera file system.
ssh -p 22 -i /.ssh/identity_vera -l root 192.168.1.xx ‘cat xxxxx’ > /tmp/btemp.txt
Using the shell works but not from Luup script.
I have also tried sending that cat output to a linux variable, so it can be later echo’ed to the file. The same command from the shell works.
os.execute(‘echo “$btemp” >/tmp/btemp.txt’)
Any idea why it does not work from Luup or if there is another way to achieve the same?
Once I have the file populated with the “value”, I will read it with local f =io.open “/tmp/btemp.txt”, and use that value to set a device variable.
Many thanks for your time.