misc: small fix or general refactoring i did not bother commenting

This commit is contained in:
evilsocket 2019-08-22 13:48:52 -04:00
commit ff3add0fe2
No known key found for this signature in database
GPG key ID: 82E42E7F3B34C97E
3 changed files with 9 additions and 6 deletions

View file

@ -65,9 +65,12 @@ func (s *Station) IsOpen() bool {
}
func (s *Station) PathFriendlyName() string {
name := strings.Replace(s.HwAddress, ":", "", -1)
name := ""
bssid := strings.Replace(s.HwAddress, ":", "", -1)
if essid := pathNameCleaner.ReplaceAllString(s.Hostname, ""); essid != "" {
name = fmt.Sprintf("%s_%s", name, essid)
name = fmt.Sprintf("%s_%s", essid, bssid)
} else {
name = bssid
}
return name
}