ssh.ts
This commit is contained in:
@@ -247,12 +247,12 @@
|
|||||||
},
|
},
|
||||||
"ssh.ts": {
|
"ssh.ts": {
|
||||||
"script_name": "ssh.ts",
|
"script_name": "ssh.ts",
|
||||||
"script_length": 6660,
|
"script_length": 6865,
|
||||||
"script_sha256": "c3ed11c0cbb3c407bf66302b209122138308cac8a57b2e41704ce1b1ca97ddb5",
|
"script_sha256": "ea4b327867b5b22269a0bb063df0ff475c90a876f1d8a4ab5d3fd5417ef01ba6",
|
||||||
"script_full_url": "https://git.hatter.ink/hatter/ts-scripts/raw/branch/main/single-scripts/ssh.ts",
|
"script_full_url": "https://git.hatter.ink/hatter/ts-scripts/raw/branch/main/single-scripts/ssh.ts",
|
||||||
"single_script_file": true,
|
"single_script_file": true,
|
||||||
"publish_time": 1768111677531,
|
"publish_time": 1768111677531,
|
||||||
"update_time": 1770400275422
|
"update_time": 1770400550100
|
||||||
},
|
},
|
||||||
"tree.ts": {
|
"tree.ts": {
|
||||||
"script_name": "tree.ts",
|
"script_name": "tree.ts",
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ async function main() {
|
|||||||
sshConfig.default_proxy || false;
|
sshConfig.default_proxy || false;
|
||||||
if (sshProxy) {
|
if (sshProxy) {
|
||||||
sshArgs.push("-o");
|
sshArgs.push("-o");
|
||||||
sshArgs.push('"ProxyCommand=nc -X 5 -x 127.0.0.1:1080 %h %p"');
|
sshArgs.push("ProxyCommand=nc -X 5 -x 127.0.0.1:1080 %h %p");
|
||||||
}
|
}
|
||||||
|
|
||||||
const sshUsername = username || sshProfile.default_username ||
|
const sshUsername = username || sshProfile.default_username ||
|
||||||
@@ -195,11 +195,19 @@ async function main() {
|
|||||||
sshArgs.push(`${sshUsername}@${sshProfile.host}`);
|
sshArgs.push(`${sshUsername}@${sshProfile.host}`);
|
||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
term.auto(`[green][OK ][/green] ${sshCommand} ${sshArgs.join(" ")}`),
|
term.auto(`[green][OK ][/green] ${sshCommand} ${
|
||||||
|
sshArgs.map((arg) => {
|
||||||
|
if (arg.includes(" ")) {
|
||||||
|
return `"${arg}"`;
|
||||||
|
} else {
|
||||||
|
return arg;
|
||||||
|
}
|
||||||
|
}).join(" ")
|
||||||
|
}`),
|
||||||
);
|
);
|
||||||
await execCommandShell(sshCommand, sshArgs);
|
await execCommandShell(sshCommand, sshArgs);
|
||||||
}
|
}
|
||||||
await main();
|
await main();
|
||||||
|
|
||||||
// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20260207T015058+08:00.MEQCIE2aMMk7tBzsdVFKzz1n
|
// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20260207T015534+08:00.MEYCIQDrK2IaMQnSL1d0Z+jd
|
||||||
// JJ3kMRKyWFqLAITwrFJMX8nVAiAQ5VK424bNfJ6k+BH5gBWkSHfWYF3e6TkuZM/esu3Fiw==
|
// G9+7qDQzyNxCR2N18b/+3lHjHQIhAM/Om/+Z6qoK2hiX84idYKeHc/JmizWUi/yqxI+xcvWl
|
||||||
|
|||||||
Reference in New Issue
Block a user