@samitouri / QOSami-HFS / commits / a4175169

command "status" now shows ports status

Massimo Melina committed Mar 3, 2026 at 12:24 UTC a4175169a7acfe3731895b9cb5a0e240aedd08f2
1 file changed +5
src/commands.ts
+5
@@ -15,6 +15,7 @@ import { downloadPlugin } from './github'
15 import { Dict, formatBytes, formatSpeed, formatTimestamp, makeMatcher } from './cross'
16 import apiMonitor from './api.monitor'
17 import { argv } from './argv'
18 +import { getServerStatus } from './listen'
19
20 if (!argv.updating && !showHelp) {
21 try {
@@ -180,6 +181,10 @@ const commands = {
181 status: {
182 params: '',
183 async cb() {
184 + const ports = await getServerStatus(false)
185 + console.log(_.map(ports, (x, k) =>
186 + `${k.toUpperCase()} ${x.configuredPort < 0 ? "disabled" : x.listening ? `on port ${x.port}` : (x.error || "not working")}`
187 + ).join(" – "))
188 const conn = (await apiMonitor.get_connection_stats().next()).value
189 if (conn) {
190 const {sent_got: sg} = conn