Update code

This commit is contained in:
User
2026-03-12 12:47:56 +08:00
parent 92e7fc5bda
commit 9dab61345c
9383 changed files with 1463454 additions and 1 deletions

View File

@@ -0,0 +1,24 @@
const { Client } = require('ssh2');
const conn = new Client();
conn.on('ready', () => {
// Get first 250 lines after deployment
const cmd = `awk '/2026-03-12 11:18:09/{found=1} found' /var/log/bigwo/server-out.log | head -250`;
conn.exec(cmd, (err, stream) => {
if (err) { console.error('exec error:', err); conn.end(); return; }
let out = '';
stream.on('data', d => out += d.toString());
stream.stderr.on('data', d => process.stderr.write(d));
stream.on('close', () => {
console.log(out || '(no output)');
conn.end();
});
});
}).on('error', err => {
console.error('SSH error:', err.message);
}).connect({
host: '119.45.10.34',
port: 22,
username: 'root',
password: '#xyzh%CS#2512@28',
readyTimeout: 10000,
});