mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
Replace individual service command initialization with unified InitServiceCmd() that creates a complete service command hierarchy. Port all original logic from initStartCmd, initStopCmd, initRestartCmd, initReloadCmd, initStatusCmd, and initUninstallCmd into ServiceCommand methods with proper dependency injection. Key changes: - Port complete Start logic including config validation, service installation, DNS management, and self-check functionality - Port complete Stop logic with deactivation pin validation and DNS cleanup - Port complete Restart logic with config validation and DNS restoration - Port complete Reload logic with HTTP status handling and restart fallback - Port complete Status logic with proper exit codes - Port complete Uninstall logic with cleanup file removal - Add all necessary flags to service commands (iface, pin, etc.) - Use InitInterfacesCmd() for interfaces subcommand - Simplify cli.go by replacing multiple init calls with single InitServiceCmd() This refactoring eliminates code duplication, improves maintainability, and ensures all service commands have their complete original functionality.