Update dependencies
This commit is contained in:
27
vendor/tailscale.com/version/distro/distro.go
generated
vendored
27
vendor/tailscale.com/version/distro/distro.go
generated
vendored
@@ -6,13 +6,12 @@ package distro
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"io"
|
||||
"os"
|
||||
"runtime"
|
||||
"strconv"
|
||||
|
||||
"tailscale.com/types/lazy"
|
||||
"tailscale.com/util/lineread"
|
||||
"tailscale.com/util/lineiter"
|
||||
)
|
||||
|
||||
type Distro string
|
||||
@@ -31,6 +30,7 @@ const (
|
||||
WDMyCloud = Distro("wdmycloud")
|
||||
Unraid = Distro("unraid")
|
||||
Alpine = Distro("alpine")
|
||||
UBNT = Distro("ubnt") // Ubiquiti Networks
|
||||
)
|
||||
|
||||
var distro lazy.SyncValue[Distro]
|
||||
@@ -76,6 +76,12 @@ func linuxDistro() Distro {
|
||||
case have("/usr/local/bin/freenas-debug"):
|
||||
// TrueNAS Scale runs on debian
|
||||
return TrueNAS
|
||||
case have("/usr/bin/ubnt-device-info"):
|
||||
// UBNT runs on Debian-based systems. This MUST be checked before Debian.
|
||||
//
|
||||
// Currently supported product families:
|
||||
// - UDM (UniFi Dream Machine, UDM-Pro)
|
||||
return UBNT
|
||||
case have("/etc/debian_version"):
|
||||
return Debian
|
||||
case have("/etc/arch-release"):
|
||||
@@ -132,18 +138,19 @@ func DSMVersion() int {
|
||||
return v
|
||||
}
|
||||
// But when run from the command line, we have to read it from the file:
|
||||
lineread.File("/etc/VERSION", func(line []byte) error {
|
||||
for lr := range lineiter.File("/etc/VERSION") {
|
||||
line, err := lr.Value()
|
||||
if err != nil {
|
||||
break // but otherwise ignore
|
||||
}
|
||||
line = bytes.TrimSpace(line)
|
||||
if string(line) == `majorversion="7"` {
|
||||
v = 7
|
||||
return io.EOF
|
||||
return 7
|
||||
}
|
||||
if string(line) == `majorversion="6"` {
|
||||
v = 6
|
||||
return io.EOF
|
||||
return 6
|
||||
}
|
||||
return nil
|
||||
})
|
||||
return v
|
||||
}
|
||||
return 0
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user