1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

simplify iwgetid use

This commit is contained in:
Alex Fornuto 2019-10-10 14:41:14 -05:00
parent 56067aef86
commit cf3cda3b13

View File

@ -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)