mirror of https://github.com/certd/certd
chore:
parent
cdd2816642
commit
4f39cb8dfa
|
@ -136,9 +136,10 @@ export class SshAccess extends BaseAccess {
|
||||||
const { SshClient } = await import("./ssh.js");
|
const { SshClient } = await import("./ssh.js");
|
||||||
const client = new SshClient(this.ctx.logger);
|
const client = new SshClient(this.ctx.logger);
|
||||||
|
|
||||||
|
const script = ["echo hello", "exit"];
|
||||||
await client.exec({
|
await client.exec({
|
||||||
connectConf: this,
|
connectConf: this,
|
||||||
script: "echo hello",
|
script: script,
|
||||||
});
|
});
|
||||||
return "ok";
|
return "ok";
|
||||||
}
|
}
|
||||||
|
|
|
@ -469,7 +469,8 @@ export class SshClient {
|
||||||
|
|
||||||
async isCmd(conn: AsyncSsh2Client) {
|
async isCmd(conn: AsyncSsh2Client) {
|
||||||
const spec = await conn.exec("echo %COMSPEC% ");
|
const spec = await conn.exec("echo %COMSPEC% ");
|
||||||
if (spec.toString().trim() === "%COMSPEC%") {
|
const ret = spec.toString().trim();
|
||||||
|
if (ret.includes("%COMSPEC%") && !ret.includes("echo %COMSPEC%")) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue