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