Closed CDuffers closed 1 year ago
Looks good, but not sure I'd put it in /tmp/
an immediate reboot will cause it to be lost I think? Size really is not an issue.
True, good point.
Where would be better?
The openenergymonitor and emoncms don't exist on first run of init and also feel an untidy place to leave the log file. /var/log feels equally as untidy
How about the home directory of the user running the command? ~/init.sh.log
How about the home directory of the user running the command
That would be my suggestion.
I've change the location to the home directory in the commit above. I've re-run a build from scratch and have the same outcome, albeit with the change of location. I can share screenshots if preferred.
Thanks @CDuffers
In response to issue (enhancement) https://github.com/openenergymonitor/EmonScripts/issues/64
The install.sh and main.sh have been updated to copy stdout and stderr to both the terminal and also a log file. The script echos the log file name at the beginning and end of the script 'tee -a' used in case the scripts are run multiple times In addition main.sh is changed to move the shell directive to the top of the script and to remove superfluous code after the "exit 0" in the final if statement. Also removed the exit to enable the script output to be shown using one command after the if
Example of
init.sh
output at the start:End of
init.sh
, including where it triggersmain.sh
, which shows where it's output is stored:main.sh
doesn't show share confirmation of log file contents when the user chooses to edit the config files, but could be easily addedAnd then when running
main.sh
for the real install:And the end of
main.sh
: