Files
bigwo/mcp-server-ssh/check_voice.cjs

21 lines
886 B
JavaScript
Raw Normal View History

const { Client } = require('ssh2');
const c = new Client();
c.on('ready', () => {
const cmd = [
"echo '=== SPEAKER ENV ==='",
"grep -oP 'VOLC_S2S_SPEAKER_ID=\\K.*' /www/wwwroot/demo.tensorgrove.com.cn/server/.env",
"echo ''",
"echo '=== LATEST SESSION CONFIG ==='",
"LAST_SID=$(grep 'upstream ready' /var/log/bigwo/server-out.log | tail -1 | grep -oP 'session=\\K[^ ]+')",
"echo \"Session: $LAST_SID\"",
"grep -E 'speaker|SayHello|tts_event|ttsType|voice|config' /var/log/bigwo/server-out.log | tail -20",
].join(' && ');
c.exec(cmd, (err, s) => {
if (err) { console.error(err); c.end(); return; }
let o = '';
s.on('data', (d) => (o += d));
s.stderr.on('data', (d) => (o += d));
s.on('close', () => { console.log(o); c.end(); });
});
}).connect({ host: '119.45.10.34', port: 22, username: 'root', password: '#xyzh%CS#2512@28' });