Enhancement to log init.sh and main.sh install scripts from issue https://github.com/openenergymonitor/EmonScripts/issues/64 #182
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In response to issue (enhancement) #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
: