]> git.proxmox.com Git - pve-container.git/commitdiff
fix restore from STDIN
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 29 Apr 2015 10:11:46 +0000 (12:11 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 29 Apr 2015 10:11:46 +0000 (12:11 +0200)
src/PVE/LXCCreate.pm

index 80786ab859a0c198da4afe5504e99e31d49480f7..8ecd849167bd7fe86cb3ef54e743763284037c33 100644 (file)
@@ -45,9 +45,14 @@ sub restore_archive {
     push @$cmd, '--anchored';
     push @$cmd, '--exclude' , './dev/*';
 
-    print "extracting archive '$archive'\n";
-    PVE::Tools::run_command($cmd);
-
+    if ($archive eq '-') {
+       print "extracting archive from STDIN\n";
+       PVE::Tools::run_command($cmd, input => "<&STDIN");
+   } else {
+       print "extracting archive '$archive'\n";
+       PVE::Tools::run_command($cmd);
+    }
+    
     # is this really required? what for?
     #$cmd = [@$userns_cmd, 'mkdir', '-p', "$rootdir/dev/pts"];
     #PVE::Tools::run_command($cmd);