From 6028b8f1868ea78eef6b6bbe1d7c543f63cb55fe Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Thu, 24 Aug 2023 11:13:08 +0000 Subject: [PATCH] internal/router/edgeos: use /etc/version for checking USG Since mca-cli-op may not be available during boot time. --- internal/router/edgeos/edgeos.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/router/edgeos/edgeos.go b/internal/router/edgeos/edgeos.go index 939012c..f50f610 100644 --- a/internal/router/edgeos/edgeos.go +++ b/internal/router/edgeos/edgeos.go @@ -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 {