mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
simplify iwgetid use
This commit is contained in:
parent
56067aef86
commit
cf3cda3b13
@ -66,14 +66,12 @@ func wifiInfo() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func wifiNameLinux() string {
|
func wifiNameLinux() string {
|
||||||
cmd := exec.Command("/usr/sbin/iwgetid", "-r")
|
cmd, _ := exec.Command("iwgetid", "-r").Output()
|
||||||
name := utils.ExecuteCommand(cmd)
|
return string(cmd)
|
||||||
if len(name) > 0 {
|
|
||||||
return name
|
|
||||||
}
|
|
||||||
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