From e48ccf2a5314504420c2cf56a0c491f25d2fb5fd Mon Sep 17 00:00:00 2001 From: Johan Denoyer Date: Wed, 30 Jan 2019 14:30:23 +0100 Subject: [PATCH] Changed nmcli cmd to check on AP connect to using '*' in the in-use field instead of 'yes/no' from the active field. This is needed for non english language set in operating system --- security/wifi.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/security/wifi.go b/security/wifi.go index 687b340a..69a07a94 100644 --- a/security/wifi.go +++ b/security/wifi.go @@ -43,10 +43,10 @@ func WifiName() string { /* -------------------- Unexported Functions -------------------- */ func wifiEncryptionLinux() string { - cmd := exec.Command("nmcli", "-t", "-f", "active,security", "dev", "wifi") + cmd := exec.Command("nmcli", "-t", "-f", "in-use,security", "dev", "wifi") out := wtf.ExecuteCommand(cmd) - name := wtf.FindMatch(`yes:(.+)`, out) + name := wtf.FindMatch(`\*:(.+)`, out) if len(name) > 0 { return name[0][1] @@ -66,9 +66,9 @@ func wifiInfo() string { } func wifiNameLinux() string { - cmd := exec.Command("nmcli", "-t", "-f", "active,ssid", "dev", "wifi") + cmd := exec.Command("nmcli", "-t", "-f", "in-use,ssid", "dev", "wifi") out := wtf.ExecuteCommand(cmd) - name := wtf.FindMatch(`yes:(.+)`, out) + name := wtf.FindMatch(`\*:(.+)`, out) if len(name) > 0 { return name[0][1] }