mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-08-10 13:20:33 +02:00
internal/router: supports UniFi UXG products
This commit is contained in:
@@ -199,7 +199,7 @@ func distroName() string {
|
|||||||
return merlin.Name
|
return merlin.Name
|
||||||
case haveFile("/etc/openwrt_version"):
|
case haveFile("/etc/openwrt_version"):
|
||||||
return openwrt.Name
|
return openwrt.Name
|
||||||
case haveDir("/data/unifi"):
|
case isUbios():
|
||||||
return ubios.Name
|
return ubios.Name
|
||||||
case bytes.HasPrefix(unameU(), []byte("synology")):
|
case bytes.HasPrefix(unameU(), []byte("synology")):
|
||||||
return synology.Name
|
return synology.Name
|
||||||
@@ -234,3 +234,14 @@ func unameU() []byte {
|
|||||||
out, _ := exec.Command("uname", "-u").Output()
|
out, _ := exec.Command("uname", "-u").Output()
|
||||||
return out
|
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