Check if a Teleport proxy is already running for the specified app_name.
(cls, app_name: str)
| 80 | |
| 81 | @classmethod |
| 82 | def check(cls, app_name: str) -> str | None: |
| 83 | """Check if a Teleport proxy is already running for the specified app_name.""" |
| 84 | |
| 85 | teleport_state = build_config.TeleportLocalState.read() |
| 86 | existing_pid = teleport_state.get_pid(app_name) |
| 87 | |
| 88 | if existing_pid and psutil.pid_exists(int(existing_pid)): |
| 89 | return teleport_state.get_pid(app_name) |
| 90 | else: |
| 91 | return None |