summaryrefslogtreecommitdiffstats
path: root/packaging
diff options
context:
space:
mode:
authorAustin S. Hemmelgarn <austin@netdata.cloud>2022-09-29 10:14:54 -0400
committerGitHub <noreply@github.com>2022-09-29 10:14:54 -0400
commitcc2586de697702f86a3c34e60e23652dd4ddcb42 (patch)
treec3cdd7d8d83c20b614a3535ddd19b3a21e630dd7 /packaging
parent22cc4d60d1af3a5e06e600307d50fc99d5409056 (diff)
Fix handling of temporary directories in kickstart code. (#13744)
Instead of checking whether the `$tmpdir` variable is set and short-circuiting if it is, we should instead check if the directory it references exists. This ensures that code that needs to use temporary directories can do so even if earlier code calls `cleanup()`
Diffstat (limited to 'packaging')
-rwxr-xr-xpackaging/installer/kickstart.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/packaging/installer/kickstart.sh b/packaging/installer/kickstart.sh
index 10f6b96647..d51e695d19 100755
--- a/packaging/installer/kickstart.sh
+++ b/packaging/installer/kickstart.sh
@@ -515,7 +515,7 @@ create_tmp_directory() {
}
set_tmpdir() {
- if [ -z "${tmpdir}" ]; then
+ if [ -z "${tmpdir}" ] || [ ! -d "${tmpdir}" ]; then
tmpdir="$(create_tmp_directory)"
progress "Using ${tmpdir} as a temporary directory."
cd "${tmpdir}" || fatal "Failed to change current working directory to ${tmpdir}." F000A