From 30c8676e15f8d45fe0451eea46ca50f8508ae15d Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Fri, 1 Jun 2018 11:25:14 +0200 Subject: [PATCH] templates: fix download template This patch fixes commit 6e62213e0294 ("templates: actually create DOWNLOAD_TEMP directory". To use mktemp -p correctly the directories need to exist. So call mkdir -p. Signed-off-by: Christian Brauner --- templates/lxc-download.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/templates/lxc-download.in b/templates/lxc-download.in index 5f1138ccf..973783ba0 100644 --- a/templates/lxc-download.in +++ b/templates/lxc-download.in @@ -319,8 +319,11 @@ fi if ! command -V mktemp >/dev/null 2>&1; then DOWNLOAD_TEMP="${DOWNLOAD_TEMP}/tmp/lxc-download.$$" -else +elif [ -n "${DOWNLOAD_TEMP}" ]; then + mkdir -p "${DOWNLOAD_TEMP}" DOWNLOAD_TEMP="$(mktemp -p ${DOWNLOAD_TEMP} -d)" +else + DOWNLOAD_TEMP="${DOWNLOAD_TEMP}$(mktemp -d)" fi # Simply list images