(ts: string)
| 124 | }; |
| 125 | |
| 126 | const tailnetDnsName = async (ts: string): Promise<string | undefined> => { |
| 127 | const { ok, out } = await sh(ts, ["status", "--json"]); |
| 128 | if (!ok) return undefined; |
| 129 | try { |
| 130 | const dns = (JSON.parse(out) as { Self?: { DNSName?: string } }).Self?.DNSName; |
| 131 | return dns?.replace(/\.$/, ""); |
| 132 | } catch { |
| 133 | return undefined; |
| 134 | } |
| 135 | }; |
| 136 | |
| 137 | // --- up -------------------------------------------------------------------- |
| 138 |