fix(auth): tighten bridge claim protocol
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { appendFileSync, closeSync, writeFileSync } from "node:fs";
|
||||
|
||||
const [, , mode, marker] = process.argv;
|
||||
|
||||
writeFileSync(marker, `started:${process.pid}\n`);
|
||||
process.on("exit", () => appendFileSync(marker, "exited\n"));
|
||||
process.on("SIGTERM", () => {
|
||||
appendFileSync(marker, "terminated\n");
|
||||
process.exit(0);
|
||||
});
|
||||
|
||||
if (mode === "stdin") {
|
||||
closeSync(0);
|
||||
appendFileSync(marker, "stdin-closed\n");
|
||||
} else if (mode === "stdout") {
|
||||
process.stdout.write(Buffer.alloc(64 * 1024 + 1));
|
||||
} else if (mode === "stderr") {
|
||||
process.stderr.write(Buffer.alloc(64 * 1024 + 1));
|
||||
}
|
||||
|
||||
setInterval(() => {}, 1_000);
|
||||
Reference in New Issue
Block a user