mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
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
This commit is contained in:
parent
c0ba7cdb6c
commit
e48ccf2a53
@ -43,10 +43,10 @@ func WifiName() string {
|
|||||||
/* -------------------- Unexported Functions -------------------- */
|
/* -------------------- Unexported Functions -------------------- */
|
||||||
|
|
||||||
func wifiEncryptionLinux() string {
|
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)
|
out := wtf.ExecuteCommand(cmd)
|
||||||
|
|
||||||
name := wtf.FindMatch(`yes:(.+)`, out)
|
name := wtf.FindMatch(`\*:(.+)`, out)
|
||||||
|
|
||||||
if len(name) > 0 {
|
if len(name) > 0 {
|
||||||
return name[0][1]
|
return name[0][1]
|
||||||
@ -66,9 +66,9 @@ func wifiInfo() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func wifiNameLinux() 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)
|
out := wtf.ExecuteCommand(cmd)
|
||||||
name := wtf.FindMatch(`yes:(.+)`, out)
|
name := wtf.FindMatch(`\*:(.+)`, out)
|
||||||
if len(name) > 0 {
|
if len(name) > 0 {
|
||||||
return name[0][1]
|
return name[0][1]
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user