mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
23 lines
498 B
Go
23 lines
498 B
Go
package ctrld
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/Control-D-Inc/ctrld/internal/system"
|
|
)
|
|
|
|
// partOfDomainOrWorkgroup checks if the computer is part of a domain or workgroup and returns "true" or "false".
|
|
func partOfDomainOrWorkgroup(ctx context.Context) string {
|
|
status, err := system.DomainJoinedStatus()
|
|
if err != nil {
|
|
ProxyLogger.Load().Debug().Err(err).Msg("Failed to get domain join status")
|
|
return "false"
|
|
}
|
|
switch status {
|
|
case 2, 3:
|
|
return "true"
|
|
default:
|
|
return "false"
|
|
}
|
|
}
|