File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 77# to be included in add-on scripts to reduce code duplication across add-ons.
88# ==============================================================================
99
10- # Unless $LOG_FD is already set to a valid fd
11- if ! [[ " ${LOG_FD-} " =~ ^[0-9]+$ ]] || ! { : >& " ${LOG_FD-2 } " ; } 2> /dev/null; then
10+ # Unless $LOG_FD is already set to a valid fd.
11+ if ! [[ " ${LOG_FD: - } " =~ ^[0-9]+$ ]] || ! { : >& " ${LOG_FD:- } " ; } 2> /dev/null; then
1212 # Preserve the original STDOUT on a free fd (stored in $LOG_FD) so that we can
13- # log to it without interfering with the STDOUT of subshells whose output we
14- # want to capture for other purposes.
13+ # log to it without interfering with the STDOUT of subshells or child processes
14+ # whose output we want to capture for other purposes.
1515 exec {LOG_FD}>&1
1616fi
17+ # Export LOG_FD for use by child bashio processes.
18+ # This is done outside of the above conditional to ensure that LOG_FD is also
19+ # exported if it was already set without using `export`.
20+ export LOG_FD
1721
1822# ------------------------------------------------------------------------------
1923# Log a message to output.
You can’t perform that action at this time.
0 commit comments