mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 18:57:17 -07:00
refact: new ListParam utility method for modules CSV parameters
This commit is contained in:
parent
fb593af38d
commit
90c1550a19
3 changed files with 46 additions and 40 deletions
|
@ -79,17 +79,8 @@ func (s *DNSSpoofer) Configure() error {
|
|||
return err
|
||||
}
|
||||
|
||||
s.Domains = make([]string, 0)
|
||||
if err, domains := s.StringParam("dns.spoof.domains"); err != nil {
|
||||
if err, s.Domains = s.ListParam("dns.spoof.domains"); err != nil {
|
||||
return err
|
||||
} else {
|
||||
parts := strings.Split(domains, ",")
|
||||
for _, part := range parts {
|
||||
part = strings.Trim(part, "\t\n\r ")
|
||||
if part != "" {
|
||||
s.Domains = append(s.Domains, part)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if err, addr = s.StringParam("dns.spoof.address"); err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue