diff --git a/lxc.js b/lxc.js index 7b851f0..01aa594 100644 --- a/lxc.js +++ b/lxc.js @@ -3,7 +3,7 @@ var exec = require('child_process').exec; function sysExec(command, callback){ command = new Buffer(command).toString('base64') - command = 'ssh virt@104.236.77.157 "' + command + '|base64 --decode|bash"'; + command = 'ssh virt@104.236.77.157 "echo ' + command + '|base64 --decode|bash"'; // command = 'unset XDG_SESSION_ID XDG_RUNTIME_DIR; cgm movepid all virt $$; ' + command; return exec(command, (function(callback){ diff --git a/routes/api.js b/routes/api.js index 8d8de8c..f7ab1b1 100644 --- a/routes/api.js +++ b/routes/api.js @@ -14,7 +14,8 @@ var usedContainers = []; var exec = require('child_process').exec; function sysExec(command, callback){ - command = 'ssh virt@104.236.77.157 ' + command; + command = new Buffer(command).toString('base64') + command = 'ssh virt@104.236.77.157 "echo ' + command + '|base64 --decode|bash"'; // command = 'unset XDG_SESSION_ID XDG_RUNTIME_DIR; cgm movepid all virt $$; ' + command; return exec(command, (function(callback){