mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
cmd/ctrld: trim os version on freebsd
This commit is contained in:
committed by
Cuong Manh Le
parent
7ccecdd9f7
commit
61b6431b6e
@@ -176,8 +176,7 @@ func initCLI() {
|
||||
initLogging()
|
||||
|
||||
mainLog.Info().Msgf("starting ctrld %s", curVersion())
|
||||
oi := osinfo.New()
|
||||
mainLog.Info().Msgf("os: %s", oi.String())
|
||||
mainLog.Info().Msgf("os: %s", osVersion())
|
||||
|
||||
// Wait for network up.
|
||||
if !ctrldnet.Up() {
|
||||
@@ -1488,3 +1487,13 @@ func dirWritable(dir string) (bool, error) {
|
||||
defer os.Remove(f.Name())
|
||||
return true, f.Close()
|
||||
}
|
||||
|
||||
func osVersion() string {
|
||||
oi := osinfo.New()
|
||||
if runtime.GOOS == "freebsd" {
|
||||
if ver, _, found := strings.Cut(oi.String(), ":"); found {
|
||||
return ver
|
||||
}
|
||||
}
|
||||
return oi.String()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user