Initial commit - full huishou project

This commit is contained in:
jiapengyu
2026-07-27 14:07:26 +08:00
commit 60790ad1b3
39127 changed files with 5989265 additions and 0 deletions
+44
View File
@@ -0,0 +1,44 @@
import { Client } from 'ssh2';
const conn = new Client();
conn.on('ready', () => {
console.log('=== 检查服务器日志 ===\n');
conn.exec('ps aux | grep node', (err, stream) => {
if (err) {
console.log('进程检查失败:', err.message);
} else {
stream.on('data', (data) => {
console.log('Node进程:', data.toString());
});
}
stream.on('close', () => {
conn.exec('tail -20 /www/server/logs/nginx/error.log', (err, stream2) => {
if (err) {
console.log('Nginx日志失败:', err.message);
} else {
stream2.on('data', (data2) => {
console.log('\nNginx错误日志:', data2.toString());
});
}
stream2.on('close', () => {
conn.end();
});
});
});
});
});
conn.on('error', (err) => {
console.log('连接错误:', err.message);
});
conn.connect({
host: 'hs.yifenbao.cn',
port: 22,
username: 'root',
password: 'Torch1112'
});