]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc-download: Fix to work without mktemp
authorStéphane Graber <stgraber@ubuntu.com>
Fri, 24 Jan 2014 23:23:28 +0000 (18:23 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Fri, 24 Jan 2014 23:23:28 +0000 (18:23 -0500)
mktemp isn't always available in busybox.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
templates/lxc-download.in

index 66894ce2e8712afdfb53ff6e58a419329e4676ca..3b1d9f93f6d950771886057b21240e9373c1fb7f 100644 (file)
@@ -249,7 +249,13 @@ fi
 
 # Trap all exit signals
 trap cleanup EXIT HUP INT TERM
-DOWNLOAD_TEMP=$(mktemp -d)
+
+if ! type mktemp >/dev/null 2>&1; then
+    DOWNLOAD_TEMP=/tmp/lxc-download.$$
+    mkdir -p $DOWNLOAD_TEMP
+else
+    DOWNLOAD_TEMP=$(mktemp -d)
+fi
 
 # Simply list images
 if [ "$DOWNLOAD_LIST_IMAGES" = "true" ] || \