From d4485f13128cc2c816a9bcf0cb3c58f8293c3859 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Sat, 6 Jan 2024 20:19:38 +0100 Subject: [PATCH] Update upgrade: simplify unecessary file descriptor magic... --- scripts/upgrade | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 2f68212..7166d6a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -41,17 +41,12 @@ then [ ! -z "${pids}" ] && kill -USR1 ${pids} # create a temporary file for the log - tmp=$(mktemp /tmp/netdata-updater-log-XXXXXX.log) - # open fd 3 and send it to tmp - exec 3>${tmp} + tmplog=$(mktemp /tmp/netdata-updater-log-XXXXXX.log) # Launch netdata installation in /opt directory pushd $NETDATA_TMPDIR - ./netdata-installer.sh --install-prefix /opt --dont-wait --disable-cloud >&3 2>&3 || ynh_die "FAILED TO COMPILE/INSTALL NETDATA" + ./netdata-installer.sh --install-prefix /opt --dont-wait --disable-cloud >$tmplog 2>$tmplog || ynh_die "FAILED TO COMPILE/INSTALL NETDATA" popd - - # close fd 3 - exec 3<&- fi # Specific configuration