mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 10:46:57 -07:00
fix: an empty string can now be used as an alias in order to remove it
This commit is contained in:
parent
ffc0b87dd4
commit
8e8e529744
2 changed files with 8 additions and 3 deletions
|
@ -93,7 +93,12 @@ func (tp *Targets) SetAliasFor(mac, alias string) bool {
|
|||
defer tp.Unlock()
|
||||
|
||||
if t, found := tp.Targets[mac]; found == true {
|
||||
tp.Aliases[mac] = alias
|
||||
if alias != "" {
|
||||
tp.Aliases[mac] = alias
|
||||
} else {
|
||||
delete(tp.Aliases, mac)
|
||||
}
|
||||
|
||||
t.Alias = alias
|
||||
tp.saveAliases()
|
||||
return true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue