mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-02-12 11:01:52 +00:00
Added SH fallback
This commit is contained in:
parent
d1ff8e5b62
commit
d2822dabbf
1 changed files with 10 additions and 1 deletions
|
@ -294,7 +294,16 @@ require('MeshAgent').AddCommandHandler(function (data) {
|
|||
if (this.httprequest.xoptions.cols) { env.COLUMNS = ('' + this.httprequest.xoptions.cols); }
|
||||
}
|
||||
var options = { type: childProcess.SpawnTypes.TERM, env: env };
|
||||
this.httprequest.process = childProcess.execFile('/bin/bash', ['bash'], options); // Start bash
|
||||
|
||||
if(require('fs').existsSync('/bin/bash'))
|
||||
{
|
||||
this.httprequest.process = childProcess.execFile('/bin/bash', ['bash'], options); // Start bash
|
||||
}
|
||||
else
|
||||
{
|
||||
this.httprequest.process = childProcess.execFile('/bin/sh', ['sh'], options); // Start sh
|
||||
}
|
||||
|
||||
// Spaces at the beginning of lines are needed to hide commands from the command history
|
||||
if (process.platform == 'linux') { this.httprequest.process.stdin.write(' alias ls=\'ls --color=auto\';clear\n'); }
|
||||
this.httprequest.process.tunnel = this;
|
||||
|
|
Loading…
Reference in a new issue