templates: fix download template

This patch fixes
commit 6e62213e02 ("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 <christian.brauner@ubuntu.com>
This commit is contained in:
Christian Brauner 2018-06-01 11:25:14 +02:00
parent 4d6301a04a
commit 30c8676e15
No known key found for this signature in database
GPG Key ID: 8EB056D53EECB12D

View File

@ -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