Update
This commit is contained in:
1 parent
007438e372
commit
6e637ecf77
1763 files changed
+60820
-279516
No files matched your search
+12
@@ -9,6 +9,7 @@ import (
|
||||
"os"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"tailscale.com/types/lazy"
|
||||
"tailscale.com/util/lineiter"
|
||||
@@ -31,6 +32,7 @@ const (
|
||||
Unraid = Distro("unraid")
|
||||
Alpine = Distro("alpine")
|
||||
UBNT = Distro("ubnt") // Ubiquiti Networks
|
||||
JetKVM = Distro("jetkvm")
|
||||
)
|
||||
|
||||
var distro lazy.SyncValue[Distro]
|
||||
@@ -102,10 +104,20 @@ func linuxDistro() Distro {
|
||||
return Unraid
|
||||
case have("/etc/alpine-release"):
|
||||
return Alpine
|
||||
case runtime.GOARCH == "arm" && isDeviceModel("JetKVM"):
|
||||
return JetKVM
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func isDeviceModel(want string) bool {
|
||||
if runtime.GOOS != "linux" {
|
||||
return false
|
||||
}
|
||||
v, _ := os.ReadFile("/sys/firmware/devicetree/base/model")
|
||||
return want == strings.Trim(string(v), "\x00\r\n\t ")
|
||||
}
|
||||
|
||||
func freebsdDistro() Distro {
|
||||
switch {
|
||||
case have("/etc/pfSense-rc"):
|
||||
|
||||
Reference in new issue
Block a user