internal/router/edgeos: use /etc/version for checking USG

Since mca-cli-op may not be available during boot time.
This commit is contained in:
Cuong Manh Le
2023-09-22 18:37:04 +07:00
committed by Cuong Manh Le
parent 126477ef88
commit 6028b8f186
+2 -2
View File
@@ -177,8 +177,8 @@ func LeaseFileDir() string {
} }
func checkUSG() bool { func checkUSG() bool {
out, _ := exec.Command("mca-cli-op", "info").Output() out, _ := os.ReadFile("/etc/version")
return bytes.Contains(out, []byte("UniFi-Gateway-")) return bytes.HasPrefix(out, []byte("UniFiSecurityGateway."))
} }
func restartDNSMasq() error { func restartDNSMasq() error {