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-08-24 11:13:08 +00:00
committed by Cuong Manh Le
parent 126477ef88
commit 6028b8f186

View File

@@ -177,8 +177,8 @@ func LeaseFileDir() string {
}
func checkUSG() bool {
out, _ := exec.Command("mca-cli-op", "info").Output()
return bytes.Contains(out, []byte("UniFi-Gateway-"))
out, _ := os.ReadFile("/etc/version")
return bytes.HasPrefix(out, []byte("UniFiSecurityGateway."))
}
func restartDNSMasq() error {