mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-03-25 23:30:41 +01:00
Add --intercept-mode flag (dns/hard/off) with configuration support, recovery bypass for captive portals, probe-based interception verification, VPN DNS coexistence in the proxy layer, and IPv6 loopback listener guard. Remove standalone mDNSResponder hack files — the port 53 binding logic is now handled within the intercept mode infrastructure. Squashed from intercept mode development on v1.0 branch (#497).
39 lines
1.1 KiB
Go
39 lines
1.1 KiB
Go
//go:build !darwin && !windows
|
|
|
|
package cli
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
// serviceConfigFileExists checks common service config file locations on Linux.
|
|
func serviceConfigFileExists() bool {
|
|
// systemd unit file
|
|
if _, err := os.Stat("/etc/systemd/system/ctrld.service"); err == nil {
|
|
return true
|
|
}
|
|
// SysV init script
|
|
if _, err := os.Stat("/etc/init.d/ctrld"); err == nil {
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
// appendServiceFlag is not yet implemented on this platform.
|
|
// Linux services (systemd) store args in unit files; intercept mode
|
|
// should be set via the config file (intercept_mode) on these platforms.
|
|
func appendServiceFlag(flag string) error {
|
|
return fmt.Errorf("appending service flags is not supported on this platform; use intercept_mode in config instead")
|
|
}
|
|
|
|
// verifyServiceRegistration is a no-op on this platform.
|
|
func verifyServiceRegistration() error {
|
|
return nil
|
|
}
|
|
|
|
// removeServiceFlag is not yet implemented on this platform.
|
|
func removeServiceFlag(flag string) error {
|
|
return fmt.Errorf("removing service flags is not supported on this platform; use intercept_mode in config instead")
|
|
}
|