MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / tailnetIp

Function tailnetIp

e2e/scripts/cli.ts:117–124  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

115/** This machine's tailnet IPv4 (100.x.y.z), from interfaces — works even
116 * when the tailscale CLI is a broken shim. */
117const tailnetIp = (): string | undefined => {
118 for (const addrs of Object.values(networkInterfaces())) {
119 for (const addr of addrs ?? []) {
120 if (addr.family === "IPv4" && addr.address.startsWith("100.")) return addr.address;
121 }
122 }
123 return undefined;
124};
125
126const tailnetDnsName = async (ts: string): Promise<string | undefined> => {
127 const { ok, out } = await sh(ts, ["status", "--json"]);

Callers 1

runFunction · 0.85

Calls 1

valuesMethod · 0.80

Tested by

no test coverage detected