Apply managed DNS mode in the macOS package

This commit is contained in:
Dev Scribe
2026-08-21 15:12:32 +07:00
committed by Cuong Manh Le
parent 1f001a559a
commit 6615e431dc
13 changed files with 432 additions and 64 deletions
+7 -3
View File
@@ -3,10 +3,14 @@
package cli
import (
"fmt"
"errors"
"os"
)
// errServiceFlagsUnsupported is returned by the service-argument helpers on
// platforms that do not store service arguments in a file ctrld can rewrite.
var errServiceFlagsUnsupported = errors.New("modifying service flags is not supported on this platform; use intercept_mode in config instead")
// serviceConfigFileExists checks common service config file locations on Linux.
func serviceConfigFileExists() bool {
// systemd unit file
@@ -24,7 +28,7 @@ func serviceConfigFileExists() bool {
// 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")
return errServiceFlagsUnsupported
}
// verifyServiceRegistration is a no-op on this platform.
@@ -34,5 +38,5 @@ func verifyServiceRegistration() error {
// 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")
return errServiceFlagsUnsupported
}