mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-09-28 07:36:38 +08:00
8ebde9dca9
* chore: update AGENTS.md with next release info * feat: node OS logo, UI rate fix, and monitor trend updates
22 lines
444 B
Go
22 lines
444 B
Go
package socket
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/shirou/gopsutil/v3/host"
|
|
)
|
|
|
|
// DetectDistro returns the Linux distribution name (e.g. "ubuntu", "centos",
|
|
// "debian"). Falls back to "linux" when detection fails.
|
|
func DetectDistro() string {
|
|
info, err := host.Info()
|
|
if err != nil || info == nil {
|
|
return "linux"
|
|
}
|
|
platform := strings.ToLower(strings.TrimSpace(info.Platform))
|
|
if platform == "" {
|
|
return "linux"
|
|
}
|
|
return platform
|
|
}
|