From 0cec756e4495c987fa268e4dd7b19f2e49021212 Mon Sep 17 00:00:00 2001 From: william Date: Fri, 29 Jan 2016 17:20:00 -0500 Subject: [PATCH] stop --- lxc.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lxc.js b/lxc.js index 8d339e4..a89af17 100644 --- a/lxc.js +++ b/lxc.js @@ -64,11 +64,11 @@ module.exports = function(config){ obj.startEphemeral = function(name, base_name, callback){ var output = ''; - sysExec('lxc-start-ephemeral -o '+base_name+ ' -n '+name +' --union-type overlayfs -d', function(data){output+=data}, function(error){ - if(output.match("doesn't exist.")) return callback({status: 500, error: "doesn't exist."}); - if(output.match("already exists.")) return callback({status: 500, error: "already exists"}); - if(output.match(/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/)) return callback({status: 200, state:'RUNNING', ip: output.match(/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/)[0]}); - callback({'?': '?', data: output, name: name, base_name: base_name}); + sysExec('lxc-start-ephemeral -o '+base_name+ ' -n '+name +' --union-type overlayfs -d', function(data){ + if(data.match("doesn't exist.")) return callback({status: 500, error: "doesn't exist."}); + if(data.match("already exists.")) return callback({status: 500, error: "already exists"}); + if(data.match(/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/)) return callback({status: 200, state:'RUNNING', ip: data.match(/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/)[0]}); + callback({'?': '?', data: data, name: name, base_name: base_name}); }); };