@usex/mikrotik-mcp 3.52.0 → 3.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +12 -5
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -3026,13 +3026,14 @@ ${entries.length} device(s) checked.
|
|
|
3026
3026
|
return ok ? 0 : 1;
|
|
3027
3027
|
}
|
|
3028
3028
|
async function main() {
|
|
3029
|
+
process.title = `MikroTik-MCP (${VERSION})`;
|
|
3029
3030
|
const argv = process.argv.slice(2);
|
|
3030
3031
|
const command = argv.find((a) => !a.startsWith("--")) ?? "serve";
|
|
3031
3032
|
if (argv.includes("--help") || argv.includes("-h") || command === "help") {
|
|
3032
3033
|
process.stdout.write(HELP);
|
|
3033
3034
|
return;
|
|
3034
3035
|
}
|
|
3035
|
-
if (argv.includes("--version") || command === "version") {
|
|
3036
|
+
if (argv.includes("--version") || argv.includes("-v") || command === "version") {
|
|
3036
3037
|
process.stdout.write(`${VERSION}
|
|
3037
3038
|
`);
|
|
3038
3039
|
return;
|
|
@@ -3054,12 +3055,18 @@ async function main() {
|
|
|
3054
3055
|
warnIfPlaintextPasswordInContainer(Object.values(cfg.devices).some((d) => !!d.password));
|
|
3055
3056
|
const deviceNames = Object.keys(cfg.devices);
|
|
3056
3057
|
logger.info(`Starting ${SERVER_NAME} v${VERSION} (transport=${cfg.mcp.transport}, ` + `devices=${deviceNames.length === 1 ? deviceNames[0] : deviceNames.join("/")}, ` + `ssh-pool=${cfg.ssh.keepAlive ? "on" : "off"})`);
|
|
3057
|
-
|
|
3058
|
+
let shuttingDown = false;
|
|
3059
|
+
const shutdown = (signal) => {
|
|
3060
|
+
if (shuttingDown)
|
|
3061
|
+
return;
|
|
3062
|
+
shuttingDown = true;
|
|
3063
|
+
logger.info(`Received ${signal}, shutting down\u2026`);
|
|
3058
3064
|
closeAll();
|
|
3065
|
+
process.exit(0);
|
|
3059
3066
|
};
|
|
3060
|
-
process.on("SIGINT",
|
|
3061
|
-
process.on("SIGTERM",
|
|
3062
|
-
process.on("exit",
|
|
3067
|
+
process.on("SIGINT", () => shutdown("SIGINT"));
|
|
3068
|
+
process.on("SIGTERM", () => shutdown("SIGTERM"));
|
|
3069
|
+
process.on("exit", closeAll);
|
|
3063
3070
|
const startDashboard = async () => {
|
|
3064
3071
|
if (!cfg.dashboard.enabled)
|
|
3065
3072
|
return;
|
package/package.json
CHANGED