stop
This commit is contained in:
parent
4071ed22d7
commit
0cec756e44
10
lxc.js
10
lxc.js
@ -64,11 +64,11 @@ module.exports = function(config){
|
|||||||
obj.startEphemeral = function(name, base_name, callback){
|
obj.startEphemeral = function(name, base_name, callback){
|
||||||
|
|
||||||
var output = '';
|
var output = '';
|
||||||
sysExec('lxc-start-ephemeral -o '+base_name+ ' -n '+name +' --union-type overlayfs -d', function(data){output+=data}, function(error){
|
sysExec('lxc-start-ephemeral -o '+base_name+ ' -n '+name +' --union-type overlayfs -d', function(data){
|
||||||
if(output.match("doesn't exist.")) return callback({status: 500, error: "doesn't exist."});
|
if(data.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(data.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]});
|
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: output, name: name, base_name: base_name});
|
callback({'?': '?', data: data, name: name, base_name: base_name});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user