]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
templates: fix download template
authorChristian Brauner <christian.brauner@ubuntu.com>
Fri, 1 Jun 2018 09:25:14 +0000 (11:25 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Fri, 1 Jun 2018 09:25:14 +0000 (11:25 +0200)
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 <christian.brauner@ubuntu.com>
templates/lxc-download.in

index 5f1138ccf2acbcdd8a27d6a2e0e542c1411b4ede..973783ba0a971b75797b8198913e93f9827b3aea 100644 (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