mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Merge pull request #584 from alexfornuto/netman-agnostic
Find SSID regardless of network manager
This commit is contained in:
commit
c9eff660f6
@ -66,15 +66,12 @@ func wifiInfo() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func wifiNameLinux() string {
|
func wifiNameLinux() string {
|
||||||
cmd := exec.Command("nmcli", "-t", "-f", "in-use,ssid", "dev", "wifi")
|
cmd, _ := exec.Command("iwgetid", "-r").Output()
|
||||||
out := utils.ExecuteCommand(cmd)
|
return string(cmd)
|
||||||
name := utils.FindMatch(`\*:(.+)`, out)
|
|
||||||
if len(name) > 0 {
|
|
||||||
return name[0][1]
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func wifiNameMacOS() string {
|
func wifiNameMacOS() string {
|
||||||
name := utils.FindMatch(`s*SSID: (.+)s*`, wifiInfo())
|
name := utils.FindMatch(`s*SSID: (.+)s*`, wifiInfo())
|
||||||
return matchStr(name)
|
return matchStr(name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user