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');
Simone