mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
internal/router: supports UniFi UXG products
This commit is contained in:
committed by
Cuong Manh Le
parent
edca1f4f89
commit
99651f6e5b
@@ -199,7 +199,7 @@ func distroName() string {
|
||||
return merlin.Name
|
||||
case haveFile("/etc/openwrt_version"):
|
||||
return openwrt.Name
|
||||
case haveDir("/data/unifi"):
|
||||
case isUbios():
|
||||
return ubios.Name
|
||||
case bytes.HasPrefix(unameU(), []byte("synology")):
|
||||
return synology.Name
|
||||
@@ -234,3 +234,14 @@ func unameU() []byte {
|
||||
out, _ := exec.Command("uname", "-u").Output()
|
||||
return out
|
||||
}
|
||||
|
||||
// isUbios reports whether the current machine is running on Ubios.
|
||||
func isUbios() bool {
|
||||
if haveDir("/data/unifi") {
|
||||
return true
|
||||
}
|
||||
if err := exec.Command("ubnt-device-info", "firmware").Run(); err == nil {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user