#!/usr/bin/env python3
"""Friendly PC-side entrypoint for deploying Daneshyar media servers.

Run with no command to add a TURN relay. The implementation lives in
setup_classroom_remote.py because the same connection and credential handling
also supports installing the primary classroom runtime and checking status.
"""

from __future__ import annotations

import sys

from setup_classroom_remote import InstallerError, main


if __name__ == "__main__":
    commands = {"install", "add-relays", "status"}
    if len(sys.argv) == 1 or sys.argv[1] not in commands:
        sys.argv.insert(1, "add-relays")
    try:
        main()
    except (InstallerError, OSError, KeyboardInterrupt) as exc:
        if isinstance(exc, KeyboardInterrupt):
            print("\nCancelled.")
        else:
            print(f"\nFAILED: {exc}", file=sys.stderr)
        raise SystemExit(1)
