mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-30 20:24:47 +00:00
chore: UPdate the shell
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { Effects } from "../../types";
|
||||
import { parseCommand } from "../../util/parseCommand";
|
||||
import { CheckResult } from "./CheckResult";
|
||||
export function containsAddress(x: string, port: number) {
|
||||
const readPorts = x
|
||||
@@ -25,8 +26,14 @@ export async function checkPortListening(
|
||||
} = {}
|
||||
): Promise<CheckResult> {
|
||||
const hasAddress =
|
||||
containsAddress(await effects.shell("cat /proc/net/tcp"), port) ||
|
||||
containsAddress(await effects.shell("cat /proc/net/udp"), port);
|
||||
containsAddress(
|
||||
await effects.runCommand(parseCommand("cat /proc/net/tcp")),
|
||||
port
|
||||
) ||
|
||||
containsAddress(
|
||||
await effects.runCommand(parseCommand("cat /proc/net/udp")),
|
||||
port
|
||||
);
|
||||
if (hasAddress) {
|
||||
return { status: "passing", message };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user