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 {
|
||||
cmd := exec.Command("/usr/sbin/iwgetid", "-r")
|
||||
name := utils.ExecuteCommand(cmd)
|
||||
if len(name) > 0 {
|
||||
return name
|
||||
}
|
||||
return ""
|
||||
cmd, _ := exec.Command("iwgetid", "-r").Output()
|
||||
return string(cmd)
|
||||
}
|
||||
|
||||
|
||||
|
||||
func wifiNameMacOS() string {
|
||||
name := utils.FindMatch(`s*SSID: (.+)s*`, wifiInfo())
|
||||
return matchStr(name)
|
||||
|
Loading…
x
Reference in New Issue
Block a user