From: Christian Brauner Date: Fri, 1 Jun 2018 09:25:14 +0000 (+0200) Subject: templates: fix download template X-Git-Tag: lxc-3.1.0~275 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=30c8676e15f8d45fe0451eea46ca50f8508ae15d;p=thirdparty%2Flxc.git 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 --- 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