summaryrefslogtreecommitdiffstats
path: root/packaging
diff options
context:
space:
mode:
authorAustin S. Hemmelgarn <austin@netdata.cloud>2021-01-04 07:11:27 -0500
committerGitHub <noreply@github.com>2021-01-04 07:11:27 -0500
commit59db8884c633e45642bed85c4e48f9a2df4d6d1d (patch)
tree567be04a16a3b7fab0d9bb611f9c3b1e4d502982 /packaging
parent1982f607e85c74838478804fd80c16bbb1c8c073 (diff)
Persist `$TMPDIR` from installer to updater. (#10384)
Diffstat (limited to 'packaging')
-rwxr-xr-xpackaging/installer/netdata-updater.sh22
1 files changed, 13 insertions, 9 deletions
diff --git a/packaging/installer/netdata-updater.sh b/packaging/installer/netdata-updater.sh
index ef7f6b1209..bc5d7b922b 100755
--- a/packaging/installer/netdata-updater.sh
+++ b/packaging/installer/netdata-updater.sh
@@ -98,18 +98,22 @@ create_tmp_directory() {
if [ -n "${NETDATA_TMPDIR_PATH}" ]; then
echo "${NETDATA_TMPDIR_PATH}"
else
- if [ -z "${TMPDIR}" ] || _cannot_use_tmpdir "${TMPDIR}" ; then
- if _cannot_use_tmpdir /tmp ; then
- if _cannot_use_tmpdir "${PWD}" ; then
- echo >&2
- echo >&2 "Unable to find a usable temprorary directory. Please set \$TMPDIR to a path that is both writable and allows execution of files and try again."
- exit 1
+ if [ -z "${NETDATA_TMPDIR}" ] || _cannot_find_tmpdir "${NETDATA_TMPDIR}" ; then
+ if [ -z "${TMPDIR}" ] || _cannot_use_tmpdir "${TMPDIR}" ; then
+ if _cannot_use_tmpdir /tmp ; then
+ if _cannot_use_tmpdir "${PWD}" ; then
+ echo >&2
+ echo >&2 "Unable to find a usable temprorary directory. Please set \$TMPDIR to a path that is both writable and allows execution of files and try again."
+ exit 1
+ else
+ TMPDIR="${PWD}"
+ fi
else
- TMPDIR="${PWD}"
+ TMPDIR="/tmp"
fi
- else
- TMPDIR="/tmp"
fi
+ else
+ TMPDIR="${NETDATA_TMPDIR}"
fi
mktemp -d -t netdata-updater-XXXXXXXXXX