tigger shell script automation

Discussions about RaZberry - Z-Wave board for Raspberry computer
simonc
Posts: 16
Joined: 16 Aug 2015 18:43

Re: tigger shell script automation

Post by simonc »

I've solved the problem , I'm writing here my thoughts maybe are useful to someone.

Using Javascript Code to execute a bash script it's Ok but there are some differences in the environment that is loaded:

- the default user is root
- the home directory is "/" and not "/root"
- Default shell is "sh" and not bash (SHELL variable is /bin/sh)

In my configuration mutt wasn't working because the home directory was wrong and it cannot write to the correct directory.
The solution for me was to set the HOME variable inside my script ( I setup the SHELL to bash too) and everything started working fine.

Very useful use the URL JS/Run to execute the script for testing and feedback purpose:

Code: Select all

http://IP_ADDRESS_RAZBERRY:8083/JS/Run/System('COMPLETE_PATH_BASH_SCRIPT');
Hope that this will be useful to someone.

Simone
bogr
Posts: 190
Joined: 16 Nov 2015 22:46

Re: tigger shell script automation

Post by bogr »

Does this really work or has something changed lately? I get:

Code: Select all

ReferenceError: System is not defined
when I try this? Can't find anything in dev-guide about existing Run-commands.
bogr
Posts: 190
Joined: 16 Nov 2015 22:46

Re: tigger shell script automation

Post by bogr »

seems like it should be .../system(...
Post Reply